Tips for resolving the 'No Spec Found' issue with TypeScript

Encountering a 'No Specfound error' while attempting to run test cases. Utilized the existing protractor methods wrapped in custom helper methods with async await.

Tried relocating the spec file and experimenting with different naming conventions, but the issue persists.

// Protractor configuration file, more information can be found at
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  SELENIUM_PROMISE_MANAGER: false,
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: ['--disable-gpu']
    }
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 90000,
  },
  onPrepare() {
    browser.manage().window().maximize();
    browser.manage().timeouts().implicitlyWait(5000);
    require('ts-node').register({
      project: 'e2e/tsconfig.e2e.json'
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { 
      displayStacktrace: 'all',
      displayPending: true, } }));
    var AllureReporter = require('jasmine-allure-reporter');
    jasmine.getEnv().addReporter(new AllureReporter({
      resultsDir: 'allure-results',
    }));
    jasmine.getEnv().afterEach(function(done){
      browser.takeScreenshot().then(function (png) {
        allure.createAttachment('Screenshot', function () {
          return new Buffer(png, 'base64')
        }, 'image/png')();
        done();
      })
    });
  },
  specs: [
    './e2e/Tests/login.spec.ts'
  ],
  onComplete() {
  },
  plugins: [
    {
      package: "protractor-console-plugin",
      failOnWarning: false,
      failOnError: true,
      logWarnings: true
    }
  ]
};

Current helper class in use:

import { browser, by, element, error, $, ExpectedConditions, WebElement, $$, ElementArrayFinder, ElementFinder, WebElementPromise } from 'protractor';
import { Type } from './common.locator.types.enum'; 

...

This is the spec file being utilized:

import 'jasminewd2';
import { LoginPage } from '../Pages/login.pageObjects';
import { HomePage } from '../Pages/home.pageObjects';
import { CommonPageHelper } from '../Common/common.helper';

  describe('Login Page Elements View Tests', () => {
    beforeAll(() => {
      const _helper = new CommonPageHelper();
      const _loginPage = new LoginPage(_helper);
      _helper.navigateTo('/account/login');
      _helper.waitForAngularEnabled(false);

      it('should display page title', () => {...});

      ...

  });

...

Answer №1

There seems to be an issue with the spec path specified in your config file

  specs: [
    './e2e/Tests/login.spec.ts'
  ],

I trust this information proves useful to you

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Error 404: The MEAN Stack has encountered a 404 Not Found error

I am currently developing a MEAN stack application and have encountered a 404 error when trying to submit a PUT request specifically for editing bookings. The editing process fails to update a particular booking. Client Side booking.service.ts getBookin ...

"An issue occurred while trying to utilize the output received from the angular service (undefined

I currently have two variables declared in my Typescript class: private myServiceSubscription: Subscription; myVar: myDto[] = []; Within the constructor: this.myServiceSubscription = this.deliveryPointService .getPostalAddresses() .subsc ...

Error encountered: "The requested resource does not have the 'Access-Control-Allow-Origin' header in Angular 6 and Nodejs."

I have encountered an issue with my Angular 6 app and Node.js. When I submit the form, I am receiving the following error: Failed to load http://localhost:3000/contact/send: Response to preflight request doesn't pass access control check: No 'Ac ...

Pass along a JSON array from Express to Angular2

I have been working on sending a custom array filled with mongoose errors, and I am successfully creating the array. Below is the code snippet: student.save(function(err, student) { if(err) var errors = []; for (field in err.errors) { ...

Calculating the number of days left within a month using dayjs

Currently, I'm facing a challenge that seems to have no easy online solution, and if there's one thing I find particularly frustrating; it's dealing with dates. My current task involves calculating a person's age in months and days. Fo ...

I can't seem to find the webdriver-update command even though I have protractor installed. What

Why am I unable to find the webdriver-update command even though Protractor is installed? I installed Protractor using the following node command: sudo npm install protractor -g However, when I attempt to update with the following command: sudo webdriv ...

Install the @agm-core package onto Angular 14

Encountering an error while attempting to install agm-core Encountering npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: @angular/[email protected] npm E ...

Even when I try to access the properties of the arguments object, it remains empty and has a zero

Why is the arguments object showing a length of zero when I pass parameters to the function, even though I can still access its properties? I am referring to the arguments object that is implemented by all JavaScript functions, allowing you to access the f ...

What is the best way to extract all Enum Flags based on a Number in TypeScript?

Given: Enum: {1, 4, 16} Flags: 20 When: I provide the Flags value to a function Then: The output will be an array of flags corresponding to the given Enum: [4, 16] Note: I attempted to manually convert the Enum to an array and treat values as numb ...

Tips for accessing the StaticRouterContext in Typescript with react-router-dom

Currently, I am implementing SSR for my app specifically targeting robots. There is a possibility that the render of the <App/> component may lead to a route not being found. In order to handle this scenario, I need to identify when the render ends ...

Exploring how to read class decorator files in a Node.js environment

I've developed a custom class decorator that extracts permissions for an Angular component. decorator.ts function extractPermissions(obj: { [key: 'read' | 'write' | 'update' | 'delete']: string }[]) { re ...

Uniting backend (Express) and frontend (Angular) paths for seamless navigation

I'm considering hosting both the Angular app and its backend on the same host (not sure if this is a good idea!). To achieve this, I created a web folder within a NodeJS (express) app and moved the deployed Angular files there. Additionally, I config ...

What could be causing the index.tsx file to not locate the Clock Module?

Here is the code snippet I have in my index.tsx file. import Clock from "./utility/clock"; And this is my tsconfig setup. { "compilerOptions": { "sourceMap": true, "noImplicitAny": true, "module": "es6", "target": "es5", ...

Angular allows for a maximum time span of 60 days between two date inputs

I am looking to implement a validation in JavaScript or TypeScript for Angular where the start date cannot be more than 60 days after the end date is entered. The requirement is to enforce a "maximum range of 60 days" between the two input dates (dateFro ...

Injecting Parameters into Angular Component Providers

One of my components inherits from another component - @Component({ template: '', providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TComp), multi: true, }, ] }) export abst ...

Having an empty string in an array used with *ngFor can lead to unusual positioning problems, unlike when the array contains non-empty strings

Check out this live demo to see it in action: https://stackblitz.com/edit/angular-5vwspd You might notice that the first 2 days are positioned strangely on the calendar. I'm currently working on a calendar component, and I am using an array called d ...

Creating a personalized validation function in Angular to validate a form field against another form field

Below is the TypeScript code for the EtcAddAuthorityComponent: export class EtcAddAuthorityComponent implements OnInit { // Code here... } The HTML code for the component is as follows: <h1 mat-dialog-title>Add Authority</h1> <div mat-di ...

Angular global value determined by build settings

Currently, I am in the process of transitioning an AngularJS 1.6 application, which is entirely built in components, to Angular 12. While everything seems to be working smoothly so far, I am encountering a major issue due to our project structure: The pro ...

Angular is disregarding certain JSON fields when creating objects

My goal is to fetch data from the wagtail API, but it returns the JSON in a complex format. { "id": 3, "meta": { "type": "home.HomePage", "detail_url": "http://localhost:8000/api/v1/pages/3/" }, "parent": null, "title": ...

Typescript - Creating a Class with Constructor that Extends an Interface without Constructor

I am faced with an interface structured as follows: interface Person { id: number name: string } In my implementation class for this interface, I have the following code: class PersonClass implements Person { id: number = 123 name: string = &apo ...