My current scenario is: the user types the username, password, and click on the login button. Then, the next screen shows a list box with Stores to login. Protractor loads this list box but it does not find any element on it. And some times I get an error when I click on any element from this list:
Stack: ScriptTimeoutError: script timeout (Session info: chrome=84.0.4147.89) (Driver info: chromedriver=84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}),platform=Windows NT 10.0.18362 x86_64)
This is my spec file
describe('Stock Take Review', function () {
it('should do user login', function () {
browser.get('myurl');
browser.driver.manage().window().maximize();
browser.sleep(1000);
element(by.id("mat-input-0")).sendKeys('user');
element(by.id('mat-input-1')).sendKeys('Pwd');
element(by.css('.full-width')).click();///////click on login
browser.sleep(1000);
}); ////////// Here the list box lists all the store, that the user should select
it('should select a shop', async function () {
let EC = browser.ExpectedConditions;
let elm = element(by.css('.mat-list-item:nth-child(1) .center'));
browser.wait(EC.elementToBeClickable(element(elm)), 150000);
await elm.click(); // select Koge store
browser.sleep(2000);
await element(by.css('.mat-fab > .mat-button-wrapper')).click(); // click on the play button
browser.sleep(2000);
});
here is the config file
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
"browserName": 'chrome',
chromeOptions: {
args: ['incognito'],
mobileEmulation: {
"device": 'Zebra TC20',
"deviceMetrics": {
"width": 340,
"height": 440,
"pixelRatio": 3.0
}
}
}
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
specs: ['../tests/StockTake_Review.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 120000
},
Any help is really appreciated!