protractor

Getting Unexpected token { at the import statement while running protractor tests from WebStorm

北城以北 提交于 2019-12-25 01:45:24
问题 I am using Node 6.4.1 and esversion 6. I am trying to run protractor tests from WebStorm but I am getting the following error during run-time. The browser is getting invoked successfully but then it stops. Error: [20:15:29] I/launcher - Running 1 instances of WebDriver [20:15:29] I/hosted - Using the selenium server at http://localhost:4444/wd/hub [20:15:33] E/launcher - Error: D:\Protractor-Final\e2e-tests\spec.js:3 import {WebDriver as browser} from "selenium-webdriver"; ^ SyntaxError:

Is there a way to bypass Chrome geolocation dialog in Protractor tests?

十年热恋 提交于 2019-12-25 01:38:47
问题 I faced this problem, when automating an application with protractor. Once I open a home page I get geolocation dialog with Block/Allow buttons, which didn't let proceed without selection either option It turned out, that this dialog is not an instance of alert, that's why browser.switchTo().alert().confirm() didn't work Passing '--disable-notifications' argument to Chrome also didn't solve the problem Research online didn't give any positive results. How to solve it? 回答1: The solution to the

Remote File Downloads

一个人想着一个人 提交于 2019-12-25 00:38:07
问题 Background : Working on some file download tests with Protractor and Chrome. I run on a selenium grid, so the tests and my Node env are executing on a server (e.g. 8.2.2.2 ) while the file downloads are on a remote windows machine (e.g. 14.3.3.3 ). The file download used to be stored on the same server that also kicked off the tests, so I was just waiting for a file to exist before performing my assertion: browser.wait(() => { return fs.existsSync(filePath) }).then(() => { // expect something

How to disable “always open these types of links in the associated app” Chrome alert

不问归期 提交于 2019-12-24 22:12:13
问题 While executing my Protractor tests in Chrome I'm getting an alert similar to below: I want to accept it to be able to continue with my tests execution. First I've tried with browser.switchTo().alert().accept() but it didn't work. Then I google'd a bit and found the following solution: chromeOptions: { prefs: { protocol_handler: { excluded_schemes: { "app": true } } }, but it didn't work either. I need to be able to accept that in order to execute remaining test steps. 回答1: Try to add -

Getting error in setting up log4js-protractor-appender in protractor

廉价感情. 提交于 2019-12-24 22:07:22
问题 My Conf.js looks like below: // An example configuration file. exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, // Framework to use. Jasmine is recommended. framework: 'jasmine', // Spec patterns are relative to the current working directory when // protractor is called. specs: ['test_spec1.js'], // Options to be passed to Jasmine. jasmineNodeOpts: { defaultTimeoutInterval: 30000 }, var log4js = require(

Browser.sleep and browser.pause do not get executed

冷暖自知 提交于 2019-12-24 20:38:14
问题 I am new to protractor and typescript and I am trying out the framework now for a PoC. However, I was wondering why the browser.sleep() or browser.pause() do not get executed in the following scenario? The test just exits right away after the first step passes. Given(/^I access the Catalogue page$/, async () => { await expect(browser.getTitle()).to.eventually.equal("Sign in to your account"); }); Then(/^I should see the product$/, async () => { browser.sleep(5000); //expect(cataloguePage

AngularJS testing with Protractor- Cannot read property 'click()' of undefined, even though 'undefined' element has already been used

本小妞迷上赌 提交于 2019-12-24 20:37:07
问题 I am developing a test suite for an AngularJS app, and have hit a strange problem while writing one of the test scripts which I can't seem to work out. The test is: it('should navigate to the Charts page', function() { console.log("Start Charts page test"); browser.waitForAngularEnabled(false); browser.wait(EC.elementToBeClickable(chartsMenuBtn), 5000).then( browser.actions(). mouseMove(chartsMenuBtn). chartsMenuBtn.click(). browser.wait(EC.urlIs(site + '/#/charts'), 5000). perform() ); })

createAttachment using mocha-allure-reporter

∥☆過路亽.° 提交于 2019-12-24 20:14:54
问题 Im trying to add a screenshot as an attachment in allure reports using mocha-allure-reporter. I dont get any errors, but the screenshot does not have save in ./reports/allure-results, and no console log either. Is this the correct way to use allure.createAttachment? declare const allure: any; afterEach('first step', function () { allure.createStep('initial', () => { browser.takeScreenshot().then(function (png) { allure.createAttachment('Screenshot', function () { return new Buffer(png,

Protractor cannot find selector in the page

淺唱寂寞╮ 提交于 2019-12-24 19:50:20
问题 I have such a code: it('should go to summary page without sending the order', async () => { stepExecutor.startTimer(); // redirects, rather than checking logging await stepExecutor.executeStep(loginWithCustomer, { name: 'loginWithCustomer', description: 'Page: login' }); // await stepExecutor.executeStep(selectFirstSubscription, { name: 'selectFirstSubscription', description: 'Page: abo first' }); }); async function loginWithCustomer() { const page = createLoginPage(browser.params.space);

Failed: unknown error: angular is not defined

﹥>﹥吖頭↗ 提交于 2019-12-24 19:25:13
问题 i have this error : - Failed: unknown error: angular is not defined (Session info: chrome=62.0.3202.94) (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.10.0-20-generic x86_64) when i execute my e2e tests when i use sendKeys : return element(by.model('email')).sendKeys('mike@test.test'); package.json : { "name": "app", "version": "0.0.0", "license": "", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "build-i18n-dev": "rm