Open Bhadja opened 3 years ago
First of all. Do you have an Angular page? If not, you need to open the page as a non-Angular application.
For more details, I found this article: browser.get vs browser.driver.get
Therefore, you can adapt your script to:
describe('Login', () => {
beforeAll(async () => {
await browser.driver.manage().window().maximize();
await browser.driver.get('/');
});
});
HI @andredesousa,
Yes, I have an Angular page at the baseURL. It runs successfully a few times but it is random. (note: the issue is happening when I run it headless thru the Azure pipeline.)
In my opinion, this is not related to protractor. I recommend that you take a screenshot, when the test fails, to see if you are on the same page.
You can see in the next file an example to take screenshots only for failed tests: https://github.com/andredesousa/essential-angular-scaffold/blob/main/e2e/protractor.conf.js
Hi @andredesousa
You're right, I was starting the dot cover at the same time as the protractor command in the pipeline, it was making the angular application unavailable for few seconds. I fixed the issue by keeping the timeout of 30 seconds right before that protractor command.
@Bhadja Nice. It´s done.
Node Version: 14.16.0
Protractor Version: 7.0.0
Angular CLI Version: 11.2.4
Browser(s): chrome headless
Operating System and Version Windows: Windows Server 2019 Standard
Protractor configuration file:
};
First few lines of the test case spec.ts:
When I'm running this test case on that server, it is running fine with the chrome session. The issue is happening when I'm running it headless thru the Azure DevOps pipeline on a self-hosted agent on the server. It works just fine sometimes but when it fails, it fails with the following error:
E/protractor - Could not find Angular on page http://srv-200201.netfective.com/ : retries looking for angular exceeded