nightwatch.js

Easiest way to run Selenium tests in a Docker container over Jenkins CI

你。 提交于 2021-02-18 07:28:51
问题 I want to execute my automated tests, written in Nightwatch-Cucumber over a Jenkins CI in a Docker container. I have a Docker image that I want to use for it. This is what I want to do in more detail. Start tests over Jenkins CI job On the same machine the Docker image is loaded and the related Docker container will start. This container based on a Unix OS. Also, some configuration in Docker container will be executed. Tests will be executed (from local or remote) in a headless mode via xvfb

Cannot hide changing element using JQuery

巧了我就是萌 提交于 2021-02-11 13:41:19
问题 Complete JQuery newbie here, so apologies if I'm missing something blatantly obvious! :) As part of my nightwatchjs test script, I'm using JQuery to try and stop a Cookie Policy window from displaying. The Cookie Policy window ID is displayed as either; div[id=sp_message_container_156527] or div[id=sp_message_container_156525] which of these is displayed is completely random, supplied by a 3rd party. So I thought I'd use JQuery to try and 'hide' this element from appearing when the page is

initClient Nightwatch - TypeError: Cannot read property 'verbose' of null

别说谁变了你拦得住时间么 提交于 2021-01-29 14:51:05
问题 I'm seeing the same error with below code. Is this a actual bug in initClient()? Any help is appreciated, thanks! async 'mydemo'(browser){ var nightwatch = require('../node_modules/nightwatch'); var config = require('../nightwatch.json'); console.log(config); var client = nightwatch.initClient(config.test_settings.default); var browserObj = client.api(); const homePage = browserObj.page.homepage(); homePage.navigate(); let result = await homePage.api.elements('css selector', 'div.flex.mt-4.v

TypeError ERR_UNESCAPED_CHARACTERS on testing Vue project using Nightwatch

邮差的信 提交于 2021-01-29 14:18:07
问题 I have a problem trying to setup my Nightwatch environment with Vue CLI. At this point, I just want to make it work with Chrome (we'll see for Firefox soon) but when I run a simple test, It doesn't work. Here is my test file: module.exports = { 'default e2e tests': browser => { browser .url("http://localhost:8080") .waitForElementVisible('#app', 5000) .assert.ok(true) .end() } } throwing the folowing error: Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED

Can nightwatch.js use usingServer from selenium-webdriver?

帅比萌擦擦* 提交于 2021-01-29 01:49:55
问题 I have a suite of tests using local drivers built with nightwatch. Works well. I am running a basic test using Perfecto Mobile and selenium-webdriver. It works with this example.(https://community.perfectomobile.com/series/20208/posts/1002862) I am trying to connect my suite of nightwatch test to perfecto, but can't start selenium. If this is the url of the selenium server. var url = "https://mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub"; I tried a few ways to set it up

Can nightwatch.js use usingServer from selenium-webdriver?

坚强是说给别人听的谎言 提交于 2021-01-29 01:43:04
问题 I have a suite of tests using local drivers built with nightwatch. Works well. I am running a basic test using Perfecto Mobile and selenium-webdriver. It works with this example.(https://community.perfectomobile.com/series/20208/posts/1002862) I am trying to connect my suite of nightwatch test to perfecto, but can't start selenium. If this is the url of the selenium server. var url = "https://mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub"; I tried a few ways to set it up

How to make es6 import/export works in Nightwatch test?

醉酒当歌 提交于 2020-12-05 03:39:17
问题 I want to import into my test file utility module, which is written in ES6 and exports several things I need. So what I do is import { module } from 'file' but it throws the 'SyntaxError: Unexpected token import' error. I tried to: add require('babel-core/register') to the top of the nightwatch.conf.js add require('babel-register')() to the top of the nightwatch.conf.js npm i babel-plugin-add-module-exports --save-dev , and add "add-module-exports" plugin to the .babelrc config file npm i

How to scroll to element using Nightwatch?

女生的网名这么多〃 提交于 2020-08-02 06:11:53
问题 I am using nightwatch for e2etesting my app. One of the tests fails because it cannot scroll to the element that it is testing I suspect. Question do I need to scroll or is there another way to do it? This is the element I am testing: return this.waitForElementVisible('#myElement', 4000) //wait for it to be visible .assert.visible('#myElement') .click('#myElement') The element is at the top of the page but the testrunner has scrolled a bit down the page and it is not visible in the screenshot

Unable to handle location access pop up on firefox using nightwatch.js

╄→гoц情女王★ 提交于 2020-06-17 23:01:58
问题 While executing selenium tests on firefox using nightwatch.js, the test where our application selects geolocation keeps failing because of a pop-up in firefox asking to allow access keeps blocking the test It works fine on chrome when the configuration is set to "chromeOptions": {"args": ["--no-sandbox","--disable-infobars"]} However, the below options for firefox does not seem to work "firefox": { "selenium_port": 1234, "desiredCapabilities": { "browserName": "firefox", "browserVersion": "74