Facebook page does not open with click - Nightwatch

Asked

Viewed 84 times

2

Hello, I recently started working with Nightwatch.js. I want to test the facebook icon.

The code is this:

module.exports = {
        "Facebook link" : function (browser) {
            browser
                .url(http://m.unitel.ao/fit/)
                .waitForElementVisible('.socal', 3000)
                .waitForElementPresent('.fa.fa-facebook', 15000)
                .useCss().click('.fa.fa-facebook')
                .pause(3000)
                .assert.urlContains('facebook')
                .end()}};

Result is this:

> Running:  Facebook link
         ? Element <.socal> was visible after 118 milliseconds. 
         ? Element <.fa.fa-facebook> was present after 21 milliseconds. 
         ? Testing if the URL contains "facebook".  - expected "facebook" but got: http: //m.unitel.ao/fit/

Running the test doesn’t open the Facebook page. Can someone help and say what’s wrong?

  • I’m not sorry, I didn’t even notice that I had gone with tags

  • To format code, use the button {} after selecting the code. No need for html tags.

  • Thank you Diego for the tip

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.