Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An action should be performed if it is shown as successful #38

Closed
sswaroopgupta opened this issue Jul 11, 2018 · 4 comments
Closed

An action should be performed if it is shown as successful #38

sswaroopgupta opened this issue Jul 11, 2018 · 4 comments
Assignees

Comments

@sswaroopgupta
Copy link
Contributor

Actual behavior
The click action is not successful, however it is shown as successful on the command line

The next step fails

Steps to replicate

  • Create a directory test
    git clone https://github.com/getgauge/taiko.git
  • Checkout branch taiko-cri
    git checkout taiko-cri
  • install taiko
    npm install -g
  • Create a testDirectory
    Add a click.js file with
const { browser, openBrowser, goto, click,below } = require('taiko');
const assert = require("assert");

(async () => {
    try {
        await openBrowser();
        await goto("https://github.com/getgauge/gauge");
        await click(link("cmd"));
        //await click(link("Why Gauge"));
        assert.equal(await title(),"gauge/cmd at master · getgauge/gauge");
        await closeBrowser();
    } catch (e) {
        console.error(e);
    } finally {
    }
})();
  • run this taiko click.js

Getting the above error.

Version

Version: 0.0.9 (HeadlessChrome/69.0.3452.0)

Blocks #29

@NivedhaSenthil
Copy link
Member

This issue is because the element is visible in the DOM but not in the viewport, the click event is triggered on the text, since it is not in viewport it did not navigate. we might have to scroll to the element if it is not in viewport like how puppeteer does.

@sswaroopgupta
Copy link
Contributor Author

But currently the step in script is passing without doing the selection or failing.

If an action fails for whatever reason, shouldn't the script fail and give the reason where the step failed?

Currently the click step is shown as successful giving the impression that the click action was successful. However, the next step fails.

@NivedhaSenthil
Copy link
Member

The click dint fail actually the mouse click got simulated but as the element was not on the viewport the onclick action dint happen, the thing that we have to fix here is scrolling up to the element to click.

@NivedhaSenthil
Copy link
Member

Fix should be available in commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants