protractor

Protractor: what's the difference between ignoreSynchronization and async/await in Protractor

徘徊边缘 提交于 2021-02-10 06:19:15
问题 I am new in Protractor. And I am doing tests to be familiar with it. Here, I met a problem what I cannot distinguish between ignoreSynchronization and async/await method. I had 3 blocks to test them. The first is clear with protractor's own async features. it('without await and ignoreSynchronization', async function() { await browser.waitForAngularEnabled(false); await browser.driver.get('https://www.baidu.com'); console.log('1'); element(by.css('#kw')).sendKeys('protractor').then(() => {

protractor: test for focus of field

房东的猫 提交于 2021-02-08 05:25:16
问题 How can I test if an input field is infocus with protractor? I'm doing this: it('should focus email field', function(){ expect(element(by.model('login.email')).getAttribute('id')).toEqual(browser.driver.switchTo().activeElement().getAttribute('id')); }); This seems to work with chrome, but this test fails with firefox. Any ideas? This is the failure message: [firefox #1] 2) Login page should focus email field [firefox #1] Message: [firefox #1] Expected 'login' to equal ''. [firefox #1]

How to start a wide browser inside a docker container, for Protractor testing

▼魔方 西西 提交于 2021-02-07 14:19:20
问题 When running end to end tests inside a docker container we need the browser to be wide, to make sure the elements (aButton) that are positioned far right are actually visible and test like expect(mainPage.aButton.isDisplayed()).toBeTruthy(); succeed. When displaying the browser width we always get a value close to 1050 as a maximum: browser.driver.manage().window().getSize().then(function(size) { console.log('browser size', size); }); displays: browser size { height: 748, width: 1050, class:

Firefox 57 does not load geckoservice in Selenium during end-to-end testing

左心房为你撑大大i 提交于 2021-02-07 10:15:30
问题 I am trying to load Firefox to test my web application using selenium. I am getting SessionNotCreatedError: Unable to create new service: GeckoDriverService error when I specify firefox in the capabilities . Here is how it looks like: var config = { sauceUser: process.env.SAUCE_USERNAME, sauceKey: process.env.SAUCE_ACCESS_KEY, framework: 'jasmine2', capabilities: { browserName: 'firefox', version: '57.0', 'screenResolution': '1920x1440' }, specs: [ '*.spec.js' ], jasmineNodeOpts: { showColors

Difference between element(…) and element(…).getWebElement() in Protractor

六月ゝ 毕业季﹏ 提交于 2021-02-07 06:14:01
问题 Why we need element(...).getWebElement() over element(...) when both works exactly the same Why two APIs for the same functionality 回答1: Protractor is a convenient wrapper around WebDriverJS - javascript selenium bindings. element(...) would result into an ElementFinder instance introduced in Protractor element(...).getWebElement() would result into a WebElement instance from WebDriverJS . Basically, this gives you access to the pure "bare-metal" WebElement . The most common use-case for

Difference between element(…) and element(…).getWebElement() in Protractor

风流意气都作罢 提交于 2021-02-07 06:13:52
问题 Why we need element(...).getWebElement() over element(...) when both works exactly the same Why two APIs for the same functionality 回答1: Protractor is a convenient wrapper around WebDriverJS - javascript selenium bindings. element(...) would result into an ElementFinder instance introduced in Protractor element(...).getWebElement() would result into a WebElement instance from WebDriverJS . Basically, this gives you access to the pure "bare-metal" WebElement . The most common use-case for

Difference between element(…) and element(…).getWebElement() in Protractor

断了今生、忘了曾经 提交于 2021-02-07 06:13:08
问题 Why we need element(...).getWebElement() over element(...) when both works exactly the same Why two APIs for the same functionality 回答1: Protractor is a convenient wrapper around WebDriverJS - javascript selenium bindings. element(...) would result into an ElementFinder instance introduced in Protractor element(...).getWebElement() would result into a WebElement instance from WebDriverJS . Basically, this gives you access to the pure "bare-metal" WebElement . The most common use-case for

Difference between element(…) and element(…).getWebElement() in Protractor

这一生的挚爱 提交于 2021-02-07 06:13:01
问题 Why we need element(...).getWebElement() over element(...) when both works exactly the same Why two APIs for the same functionality 回答1: Protractor is a convenient wrapper around WebDriverJS - javascript selenium bindings. element(...) would result into an ElementFinder instance introduced in Protractor element(...).getWebElement() would result into a WebElement instance from WebDriverJS . Basically, this gives you access to the pure "bare-metal" WebElement . The most common use-case for

Protractor browser.wait doesn't wait

允我心安 提交于 2021-02-05 19:47:16
问题 I am assuming that browser.wait should be a blocking call, but it is not working as I expected. Here is my sample: describe("browser.wait", function() { beforeEach(function() { browser.wait(function() { console.log('1 - BeforeEach WAIT'); return true; }); console.log('2 - BeforeEach after wait'); }); afterEach(function() { browser.wait(function() { console.log('4 - afterEach WAIT'); return true; }); console.log('5 - afterEach after wait'); }); it('should probably actually wait.', function() {

Protractor browser.wait doesn't wait

主宰稳场 提交于 2021-02-05 19:41:25
问题 I am assuming that browser.wait should be a blocking call, but it is not working as I expected. Here is my sample: describe("browser.wait", function() { beforeEach(function() { browser.wait(function() { console.log('1 - BeforeEach WAIT'); return true; }); console.log('2 - BeforeEach after wait'); }); afterEach(function() { browser.wait(function() { console.log('4 - afterEach WAIT'); return true; }); console.log('5 - afterEach after wait'); }); it('should probably actually wait.', function() {