nightwatch.js

nothing happens after .url() calling

跟風遠走 提交于 2019-12-10 15:19:23
问题 I have the following nightwatch test: module.exports = { 'Set Initial Dataset' : function (browser) { browser .url('http://localhost/nightwatch/load-initial-dataset') .end() } } When I execute it the browser is opened and the url is loaded, but when the loading is ended it doesn't close the browser to begin the next test. The test worked 1 month ago... I updated nightwatch to the nigthwatch latest version (v0.9.8), downloaded selenium-server-standalone-3.0.1.jar , chromedriver 2.25 and Chrome

Mocha unable to run with Nightwatch

人盡茶涼 提交于 2019-12-10 11:44:30
问题 I'm running mocha with nighwatch.js, selenium and chromedriver I'm able to run with describe, and it, but I'm making a dynamic tests, so I need use the following way to invoke, but I'm unable to get mocha running this way with nightwatch "use strict"; var nightwatch = require('nightwatch'); var Mocha = require('mocha'); var Test = Mocha.Test; var Suite = Mocha.Suite; var mocha = new Mocha(); var suite = Suite.create(mocha.suite, 'Search Box'); suite.addTest(new Test('I\'m a dynamic test',

Nock does not work with Nightwatch + Selenium

两盒软妹~` 提交于 2019-12-09 23:05:57
问题 I am using nock to mock my http requests. My app is written using Redux + React. import nock from "nock" nock("http://localhost:8080") .log(console.log) .get("/fake/users/sign_in.json") .reply(500, 'Error') const doLogin = (browser) => { return browser .url("http://localhost:8080") .waitForElementVisible('form', 1000) .setValue('input[name=email]', 'foo@foo.com') .setValue('input[name=password]', 'somepass') .click('button[type=submit]') .pause(500) } export default { "Do login and receive

NightwatchJS .elements returning string and not objects

我怕爱的太早我们不能终老 提交于 2019-12-09 18:00:57
问题 I am using nightwatch and trying to iterate through a list of elements. However, when I don't get objects or elements, but I get an array of strings. CODE browser.elements("css selector", ele, function(r){ browser.perform(function(){ console.log("LIST", r); }) }) RETURN LIST { sessionId: 'b273b874-c084-4d17-8bbe-a911a170ef25', status: 0, state: 'success', value: [ { ELEMENT: '6' }, { ELEMENT: '7' }, { ELEMENT: '8' }, { ELEMENT: '9' }, { ELEMENT: '10' }, { ELEMENT: '11' } ], class: 'org.openqa

Hovering over a link in nightwatchjs

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 02:38:19
问题 I have been using nightwatch.js and always clicked around elements. Is there a way we can hover over a link or button? 回答1: Try the browser.moveToElement command. You can also fire a callback after moveToElement completes: browser.waitForElementVisible('.recommendation', 1000, function () { // moveToElement can also accept offsets browser.moveToElement('.recommendation', 100, 100, function() { browser.waitForElementVisible('.share', 500, function () { browser.click('.share'); }, "Click share

How can I check until an element is clickable using nightwatchjs?

拜拜、爱过 提交于 2019-12-08 16:01:22
问题 How can I check until an element is clickable using nightwatch js? I want to click on an element but when I run nightwatch, selenium does not click on the element because it is not clickable yet. 回答1: Something like this should work. Let me know if you have questions var util = require('util'); var events = require('events'); /* * This custom command allows us to locate an HTML element on the page and then wait until the element is both visible * and does not have a "disabled" state. It

Nightwatch - Use chromedriver

不问归期 提交于 2019-12-08 15:06:55
问题 So i saw a similar question on stack here but it did not have an accepted answer nor did it provide me with the information i needed.. I am trying to use 'chromedriver' because 'selenium-webdriver' requires a FF version <= 28. What i've done so far. nightwatch.js tests running fine in FF downloaded chromedriver ( npm install chromedriver -g ) and also npm install chromedriver into my nightwatch project directory went to nightwatch/bin/nightwatch.json and edited the following code "selenium" :

how to modulate my functions as seperate parallel tests?

那年仲夏 提交于 2019-12-08 10:52:30
问题 I am using nightwatch.js and browser stack and am running a series of test functions that look like below; that run through my application from login point to deeper actions. i.e. this.TeamPanel = function(browser) { browser .url(Data.urls.oppListing) .waitForElementVisible("div#team.btn-icon", 1000) .click("div#team.btn-icon") .waitForElementVisible("div.side-panel.open", 1000) // .waitForElementVisible("div.box.team-member-summary-wrap.editable.fade-enter-done", 1000) //

Validating download file in Nightwatch

早过忘川 提交于 2019-12-08 05:00:34
问题 I am Trying to write a test using nightwatch js to validate the file is downloaded after click on button/link in the web page. No need to check data inside file, i would only require to check if the file is downloaded or not. Also before I download I have to delete the existing files from download folder so that copy of same file doesn't occur. How this can be achieved in Nightwatch js? Please help me. 来源: https://stackoverflow.com/questions/47186671/validating-download-file-in-nightwatch

Random failure of selenium test on test server

狂风中的少年 提交于 2019-12-08 02:52:09
问题 I'm working on a project which uses nodejs and nighwatch for test automation. The problem here is that the tests are not reliable and give lots of false positives. I did everything to make them stable and still getting the errors. I went through some blogs like https://bocoup.com/blog/a-day-at-the-races and did some code refactoring. Did anyone have some suggestions to solve this issue. At this moment I have two options, either I rewrite the code in Java(removing nodejs and nightwatch from