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', () => {...});
...
});
...