Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 06 21:51
    CLAassistant commented #2971
  • Dec 06 21:51
    CLAassistant commented #2971
  • Dec 06 16:22
    harshit-bs synchronize #2971
  • Dec 06 16:22
    harshit-bs synchronize #2971
  • Dec 06 16:18
    CLAassistant commented #2971
  • Dec 06 16:18
    CLAassistant commented #2971
  • Dec 06 16:17
    harshit-bs opened #2972
  • Dec 06 16:17
    harshit-bs opened #2972
  • Dec 06 16:16
    harshit-bs opened #2971
  • Dec 06 16:16
    harshit-bs opened #2971
  • Dec 06 16:00
    harshit-bs synchronize #2960
  • Dec 06 16:00
    harshit-bs synchronize #2960
  • Dec 06 16:00
    harshit-bs closed #2960
  • Dec 06 16:00
    harshit-bs closed #2960
  • Dec 06 15:50
    harshit-bs synchronize #2960
  • Dec 06 15:50
    harshit-bs synchronize #2960
  • Dec 06 15:25
    beatfactor updated the wiki
  • Dec 06 15:24
    beatfactor updated the wiki
  • Dec 06 14:59

    beatfactor on main

    added what's new link (compare)

  • Dec 06 14:59

    beatfactor on main

    added what's new link (compare)

Ravi Sawlani
@gravityvi
Hi all, Nightwatch v2-alpha.3 is published in NPM. It has a tight integration with Cucumber. There is also a repository with examples, boilerplate, and a lot of predefined cucumber steps: https://github.com/gravityvi/cucumber-nightwatch-boilerplate
Victoria0214
@Victoria0214
Hi all!
I have a test and fail message
buildPlanPage.assert.containsText('@activeButton','Gravity Only')
Testing if element <Element [name=@activeButton]> contains text 'Gravity Only' in 5000ms - expected "contains text 'Gravity Only'" but got: "does not contain 'Gravity Only'"
Is it possible somehow to have message like
expected "contains text 'Gravity Only'" but got: "real text that element has" ?
radu
@RaduBuciuceanu
Hey guys. If I use the --suiteRetries option, my github action runs forever (it sais passed successfully but does not exit). I run it using the following command:
xvfb-run --auto-servernum --server-args='-screen 0, 1920x1080x24' yarn test -e local --suiteRetries 3 --verbose. Did any of you ever meet this problem?
radu
@RaduBuciuceanu
Update for the above question. Same thing happens on local when running: yarn test -e local --suiteRetries 3.
And one more update. I downgraded nightwatch to v1.7 and all works good. It seems to be a bug in the v2.
1 reply
some_body
@some_body:matrix.org
[m]
Hello - Thank you very much for nightwatchjs. Been using for a few months and enjoying. Just came to a requirement that a test simulate various network connectivity conditions, including no connectivity for X seconds. Familiar with how to do this with puppeteer, and webdriver.io - is there a way that this community recommends proceeding with nightwatchjs?
some_body
@some_body:matrix.org
[m]
hey @Victoria0214, IIUC, you should be able to use .containsText with a custom message via the optional msg parameter - https://nightwatchjs.org/api/#assert-containsText.
John Degey
@johndegey
Hello all, I'm new to nightwatch... i use the alpha.4. I try to launch chrome with an unpacked extension or firefox with a packed extension in zip format. For chrome, I try with the "arg: ['--load-extension=/path/to/my/extension/code']" in the conf file but it does not work (similar config works with puppeter or php-webdriver). For Firefox, I'm trying to use firefox.installAddon... but I must do something wrong and I could not find an example... Could someone points me to the right direction ? Thx
Ravi Sawlani
@gravityvi
Hey @johndegey, could you share your nightwatch config file
John Degey
@johndegey

Hello @gravityvi, I start with the auto-generated one so I put only the chrome part :

chrome: {
desiredCapabilities : {
browserName : 'chrome',
'goog:chromeOptions' : {
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
//
// This tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
w3c: true,
args: [
'--load-extension=/home/john/Dev/Liberty/libertyGC'
]
}
},
webdriver: {
start_process: true,
server_path: '',
cli_args: [
// --verbose
]
}
},

I try w3c: false/true... does not matter
John Degey
@johndegey
For Firefox, they don't have any command line argument to embed an unpack or packed web-extension, I never succeed to installed my extension, neither with php-webdriver or puppeeter, seems Mozilla is stuck in previous century....
1 reply
So when I read the news on the blog saying that new alpha implements something like browser.installAddon, I give it a try full of hope ;)
but it lacks of exemple and I'm a bit lost on how to code this
Elior Cohen
@eliorcohen
Hey, I'm trying to figure out the expected behaviour for "abortOnAssertionFailure" when using Async/Await.
when i'm using ES6 Async Await and calling "waitForElementVisible" if the element is not found, the test continue to execute, the function is not throwing an Error to stop the test.
if i'm using the regular syntax browser.waitForElementVisible(selector, timeout); it work as expected, fails the test and skip the other ones
when using await browser.waitForElementVisible(selector, timeout); the test continue and ignore the flag of 'abortOnAssertionFailure'
the test will still fail, but will continue to run until it's done. and it's not my intention
Ravi Sawlani
@gravityvi
@johndegey try using capabilities like this:
const chrome = require('selenium-webdriver/chrome');
const capabilities = new chrome.Options();
capabilities.addExtention(<file-path>)

module.exports = {
  test_settings: {
    chrome: {
      capabilities,
      webdriver: {
        start_process: true,
        server_path: require('chromedriver').path,
        cli_args: [
          // --verbose
        ]
      }
    }
  }
};
@eliorcohen seems to me like a bug could raise an issue regarding this on github?
Elior Cohen
@eliorcohen
@gravityvi just found some old bug that may be related (i guess that waitForVisible using the assert functionality) - nightwatchjs/nightwatch#2535 , it's a year old and still open
3 replies
i't trying a simple solution wo wrap the command and handle the async result
function waitForElementVisible(selector, timeout = 1500) {
  return new Promise((resolve, reject) => {
    console.log(`elementIsVisible:${selector}`);
    b.waitForElementVisible(selector, timeout, (data) => {
      if (data.status === -1) reject(data.result.error);
      resolve();
    })
  });
}
this is something that seems to be built-in the engine, it's check for ES6 and Async in the _watFor and such and can throw this error instead of returning a valid result for status inspection
John Degey
@johndegey
@gravityvi Hi, nothing seems to work, (type => capabilities.addExtensions), I delete the config file and regenerate it again and try simple change : can't even start in headless mode or maximized... no options are reflected in the command line use . If I use the logged command line from chromedriver.log, add --load-extension=/my/path/to/ext/folder --start-maximized, everything works fine. Also, the autogenerated file use the entry "goo:chromeOptions" in chrome.desiredCapabilities and use "chromeOptions" in 'selenium.chrome'.desiredCapabilities, this is confusing...
I try to set chrome binary but it is always using the same version, the 'chromeOptions - binary' does not work
could be great to have a complete conf file with all options as an example
John Degey
@johndegey
I give a try to the last v1, it is even worst than the v2 alpha... can't even start a chrome browser, it always start geckodriver... but use chromedriver.log as log file.... strange to see Marionnette Info for chrome...
Andrei Rusu
@beatfactor
you seem to be having a hard time there
I'm pretty confident Nightwatch is able to start a chrome browser by now...
over all these years, you'd imagine that the team would have figured that one out by now

here's how I do it:

npm install chromedriver
nightwatch --env chrome

it never fails.

Andrei Rusu
@beatfactor
About the goog:chromeOptions, I know it sucks. I never know which one is it either. I think both of them work.
John Degey
@johndegey
Ok, stupid I am... I did not notice that the autogenerated file for v1 as the webdriver.server_path set to geckodriver ;(
for the default and that the config chrome.webdriver did not override this....
2 replies
John Degey
@johndegey
@beatfactor yes, that's why after that I start to verify my dev machine before returning to code ^^
It only 2 days I play with Nightwatch (v2 alpha), I did not notice the difference about the server_path :)
John Degey
@johndegey
@beatfactor YES.... as soon as I understand that only the config in the "default" entry was used and that none of the chrome/firefox config overrides the default...
making a default only with chrome settings works
I have read the manual and use the auto-generated file but I did not understand that only de "default" entry was usefull... my fault
I should have excepted that since for browserstack.chrome, it has a extends: 'browserstack'
John Degey
@johndegey
If you have an example for loading an extension with Firefox, I will be more than happy :)
22 replies
Victoria0214
@Victoria0214
Hi! Could you advice please how to use elementIdText in page object?
this.api.elementIdText -> Cannot read property 'elementIdText' of undefined
this.elementIdText -> this.elementIdText is not a function
  checkElementsTextIsEqual(selector, text) {
    this.api.elements(selector, function (elements) {
      elements.value.forEach(function (res) {
        this.elementIdText(res.ELEMENT, function (result) {
          this.assert.equal(result.value, text);///
8 replies
Victoria0214
@Victoria0214
this function is in fileExplorer page, and I call it in specs fileExplorer.checkElementsTextIsEqual("@itemType", "Folder");
Ravi Sawlani
@gravityvi
Nightwatch v2 is now available in Beta :tada: . You can try it out with: npm install nightwatch@next. You can find more details in the this blog post: https://nightwatchjs.org/blog/nightwatch-v2-beta-is-available.html
Leo Laskin
@llaskin
is there a way to get the webdriver "driver" or "browser" object out of the "client" object?
1 reply
Ravi Sawlani
@gravityvi
Hey @llaskin, what's the version of Nightwatch you are using?
Alex
@awulkan
Is the console window supposed to pop up during every test on version 2.0.0-beta.1?
8 replies
psyfreak-dev
@psyfreak-dev
How to customize nightwatchjs xml output ?. Is it possible to do that. Thanks :pray