This automation framework follows the page object model and utilizes the async/await approach rather than promises. TypeScript is used, with compilation to JavaScript (protractor) for script execution.
Page Object:
async addProjectDetails(): Promise<void> {
expect(await this.currentStep.getText()).toBe("Records"); //There is no element like this, which I know.
await this.projectTitle.sendKeys("Project Feb 1");
await this.projectDescription.sendKeys("Project Description");
}
Spec:
it('should create a project successfully', async () => {
try {
await dashboard.createNewProject();
await dashboard.addProjectDetails();
}
Upon page load, an element is missing resulting in the error:
NoSuchElementError: No element found using locator: By(xpath, //custom-expandable-title[@class='not-completed active']//span[@class='child-title'])
Even though the element is not present, the test does not fail as expected. This raises the question of it being a false positive outcome.