Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:29

    beatfactor on main

    Fix broken link in getting-star… (compare)

  • 12:29
    beatfactor closed #144
  • 12:28

    beatfactor on main

    Correct indentation of example … (compare)

  • 12:28
    beatfactor closed #145
  • 12:14
    garg3133 opened #145
  • 08:11
    beatfactor closed #2999
  • 08:11
    beatfactor closed #2999
  • 08:11
    beatfactor commented #2999
  • 08:11
    beatfactor commented #2999
  • 08:09

    beatfactor on v2.0.0-beta.3

    (compare)

  • 08:09

    beatfactor on v2.0.0-beta.3

    (compare)

  • 08:09

    beatfactor on v2.0.0-dev.13

    (compare)

  • 08:09

    beatfactor on v2.0.0-dev.13

    (compare)

  • 08:09

    beatfactor on v2.0.0-dev.14

    (compare)

  • 08:09

    beatfactor on v2.0.0-dev.14

    (compare)

  • 08:08

    beatfactor on main

    2.0.0-beta.3 (compare)

  • 08:08

    beatfactor on main

    2.0.0-beta.3 (compare)

  • 06:17
    vaibhavsingh97 assigned #2999
  • 06:17
    vaibhavsingh97 assigned #2999
  • 06:17
    vaibhavsingh97 unassigned #2999
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
Cleverson Sampaio
@clevsampaio
image.png
How do I force the error to be a true error for the cucumber, I don't want it to appear that in the end it was all right
I've already used try/catch, but it doesn't work
Cleverson Sampaio
@clevsampaio
This happens with the sendKeys command.
I've tried using "suppressNotFoundErrors" but it doesn't seem to work
dharls36
@dharls36

I'd like to load a page and perform some functions before the start of each of my tests.

Is this possible?

I've added this in my globals file, but it doesn't seem to work;

module.exports = {
    beforeEach: function (browser, done) {
        console.log('setting up the test...');
        browser.url('https://www.******.co.uk');
        browser.pause(10000);
        done();
    }
};

Am I doing something obviously wrong with this, as it doesn't seem to display the 'setting up the test' text or load the webpage before the test starts. Thanks.

dharls36
@dharls36

Ok, so I now need to run code in my command script that references an entry in my globals file.

So far, my code looks like this in my command file;

var cmsDataNewsLetterSettings = require('../../config/commands/solr_query/globalSettings/newsletterSignUp');
var cmsNewsletterSettingsPage;

module.exports = {
     before: function(done) {
        var solrPrdCmsClient = this.globals.solrPrdCmsClient;
        cmsDataNewsLetterSettings.newsletter_signup_prompt_settings(solrPrdCmsClient, function(err,cmsNewsletterSettings) {
            if(err) {
                console.log(err);
                done(err);
            } else {
                cmsNewsletterSettingsPage = cmsNewsletterSettings;
                done();
            }
        });
    var numberOfPagesBeforePromptDisplayed = cmsNewsletterSettingsPage.i_NewsletterSignupPageViewThreshold;
    console.log(numberOfPagesBeforePromptDisplayed);
    }
};

However, I'm getting the error message;

command: "TypeError: Cannot read property 'solrPrdCmsClient' of undefined

Am I right in thinking that this error is caused by the command script not recognising the globals reference, or is the error elsewhere? Thanks.

Freddie
@fredski02
I'm using my camera and microphone. I get a permissions pop up, is there a way i can hit accept or tell chrome to auto accept in a config?
Victoria0214
@Victoria0214
Hi all nightwatch users! Which reporter could you advice? I see some bugs related to screenshots in already used allure reporter https://www.npmjs.com/package/nightwatch-allure, and #This project is no longer being maintained
Do you have some examples of successful and useful reporter?
dharls36
@dharls36

Hi.

As part of a beforeEach hook, I have this in my globals.js file;

var launchUrl = 'https://www.parkers.co.uk/';

module.exports = {
    beforeEach: function (browser, done) {
        browser.testSetup(launchUrl);
        done();
    },

However, instead of the definitive https://www.parkers.co.uk for the launchUrl, I'd like to reference this in a similar way as my test cases, so that it can be used for each environment (dev, test, etc). For example, in my test cases this URL is defined in the form of browser.launch_url, which it gets from my nightwatch.conf.js config file;

test_settings: {
        default: {
              launch_url: 'https://www.parkers.co.uk/'
          },

Is it possible to reference this nightwatch.conf.js entry within the globals.js file?

Any help would be greatly appreciated.