protractor

Protractor does not run after installation

只谈情不闲聊 提交于 2019-12-23 01:56:05
问题 After installation npm i protractor -g and running webdriver-manager update as in Tutorial, the next command webdriver-manager start throws errors: $ webdriver-manager start seleniumProcess.pid: 63737 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncher : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:700) at java.security.SecureClassLoader

Protractor Page objects - TypeError: Object #<Object> has no method 'methodName'

微笑、不失礼 提交于 2019-12-23 01:54:37
问题 I'm trying to write a simple test using page objects pattern - based on the 'docs/page-objects'. I created a file describing the page object and other using this page object to test a page. //page object var LoginPage = function() { this.userInput = browser.driver.findElement(by.id('username')); this.pwdInput = browser.driver.findElement(by.id('password')); this.btnEnter = browser.driver.findElement(by.id('btnLogin')); this.get = function(){ browser.get('http://example.com'); }; this.setUser

How to wait for the backend in Protractor?

别来无恙 提交于 2019-12-23 01:12:40
问题 I'm testing a web page where the user can send a message to another via a textinput. A POST request is then send on the server and the message is dumped on the disk in the var/mail/new folder. After automatising the sending of the message in the page with Protractor I'm calling browser.waitForAngular() and browser.driver.sleep(4000) to leave time for the backend to write the mail on the disk. After these calls the check of the email's presence fails. When looking in the Unix shell, I can

AngularJS e2e tests hang when changing between two separate angular apps

て烟熏妆下的殇ゞ 提交于 2019-12-22 19:31:16
问题 I have a frustrating problem: I want to write end to end tests for a complex angular app. The problem is that the login screen is a separate app. The initial idea was that it would branch out to separate other angular apps in our ecosystem based on the login credentials. It works like a charm. For the tests it is a nightmare though. The tests work as expected but as soon as correct credentials are entered and the main angular app is loaded the tests just time out. No error message or debug

AngularJS e2e tests hang when changing between two separate angular apps

余生长醉 提交于 2019-12-22 19:31:13
问题 I have a frustrating problem: I want to write end to end tests for a complex angular app. The problem is that the login screen is a separate app. The initial idea was that it would branch out to separate other angular apps in our ecosystem based on the login credentials. It works like a charm. For the tests it is a nightmare though. The tests work as expected but as soon as correct credentials are entered and the main angular app is loaded the tests just time out. No error message or debug

How to override new Date() on Protractor tests

拜拜、爱过 提交于 2019-12-22 19:14:27
问题 I've an app that changes it's behaviour with the date. On my mock tests I need to override the new Date() function to test all the scenarios. Does anyone know how to override it? I already tried to use the executeScript to change the return value but it doesn't work. browser.driver.executeScript('' + 'Date = function(){return new Date(2012, 0, 20)};' ); 回答1: The replacement function depends on the original Date that's been replaced, so keep a reference to it in a closure, e.g.: var Date =

Protractor Exits with code 0 even though tests are failing

孤人 提交于 2019-12-22 18:39:25
问题 I am running protractor v4.0.9 via npm, and noticed that my build on Visual Studio Team Services does not fail even when tests are reported as failing. Looking into this further, I introduced an error so that tests would fail and then ran them locally. As the screenshot below shows, I have 17/17 failing tests, but the exit code is still 0, which I understand is a success. It even says chrome #01 passed , which I assume is wrong. Here is my protractor config: "use strict"; exports.config = {

Protractor addMockModule additional arguments not working?

自作多情 提交于 2019-12-22 18:32:50
问题 This seems so, so easy, but I can't figure out why this simple code doesn't work. I am adding a mock module to mock my API backend in my Angular E2E tests. I'm using Protractor 1.6.0. I need to pass additional arguments to the mocked module, which, according to the Protractor docs, is possible by just sending them as additional arguments. However, my function claims it has no arguments... var mock = function() { // This is undefined and arguments.length is 0....why??? var env = arguments[0];

Getting the Angular Content to load in protractor tests

一世执手 提交于 2019-12-22 17:55:14
问题 I have an angular application that I am writing e2e test for using protractor. Following is my conf.js file setup var project = require('./package.json'); var HtmlReporter = require('protractor-jasmine2-screenshot-reporter'); var multiCapabilities = [{ 'browserName': 'chrome' }]; multiCapabilities = [{ 'browserName': 'chrome', "platform": "Windows 7", 'build': 'Testing', 'name': project.name + ' tests' }] exports.config = { framework: 'jasmine2', sauceUser: 'blahblhablah', sauceKey:

Running Protractor against a nightly Firefox build

非 Y 不嫁゛ 提交于 2019-12-22 17:28:08
问题 When I try to run Protractor tests against a "Nightly" Firefox build, firefox window hangs indefinitely : Here is the relevant part of my configuration: exports.config = { baseUrl: 'http://localhost:8080/dev/src/', specs: ['dev/test/e2e/**/dashboard.spec.js'], directConnect: true, capabilities: { browserName: "firefox", firefox_binary: "/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin", }, allScriptsTimeout: 110000, getPageTimeout: 100000, framework: 'jasmine2', jasmineNodeOpts: {