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

Should be able to execute the same script with different User Interface (UI) librarys #603

Closed
sswaroopgupta opened this issue Jun 9, 2019 · 6 comments
Assignees

Comments

@sswaroopgupta
Copy link
Contributor

Expected behavior

I should be able to execute a todo app script recorded for reactjs with angularjs

Actual behavior

The script seems hung when executing with angularjs

Steps to replicate

  • Run script
const { openBrowser, goto, write, press, click, near, checkBox, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser({headless:false},{timeout:60000});
        await goto("http://todomvc.com/examples/react/#/");
        await write("Working with examples");
        await press("Enter");
        await click("Working with examples");
        await click(checkBox(near("Working with examples")));
        await click("Clear completed");
    } catch (e) {
        console.error(e);
    } finally {
        await closeBrowser();
    }
})();

This works as expected

  • Now run the script
const { openBrowser, goto, write, press, click, near, checkBox, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser({headless:false},{timeout:60000});
        await goto("http://todomvc.com/examples/angularjs/#/");
        await write("Working with examples");
        await press("Enter");
        await click("Working with examples");
        await click(checkBox(near("Working with examples")));
        await click("Clear completed");
    } catch (e) {
        console.error(e);
    } finally {
        await closeBrowser();
    }
})();

This script seems hung. It is not able to write on to the field with default focus

Version

commit - 7482e63f741fde16ff9fb9db5267b37dc51931e3
@sswaroopgupta
Copy link
Contributor Author

The same holds good when the URL http://todomvc.com/examples/typescript-backbone/ is used

@sriv
Copy link
Member

sriv commented Jun 10, 2019

I believe taiko does not handle virtual DOMs well. taiko-react is an example where a plugin can bridge this gap.

@zabil
Copy link
Member

zabil commented Jun 10, 2019

@sriv According to the issue, the script works on React applications but does not on non virtual dom frameworks like angular and backbone.

@sriv
Copy link
Member

sriv commented Jun 10, 2019

ah right. I stand corrected.

NivedhaSenthil added a commit that referenced this issue Jun 10, 2019
@NivedhaSenthil NivedhaSenthil self-assigned this Jun 10, 2019
@NivedhaSenthil
Copy link
Member

The issue was happening in headful mode as the goto action was performed before openBrowser was complete. Fix available in 50bbc07, should work fine for all frameworks.

@Debashis9012
Copy link
Contributor

Verified and tested this issue with the commit version 50bbc07.
The below script is working with different user interface libraries:

const { openBrowser, goto, write, press, click, near, checkBox, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser({headless:false},{timeout:60000});
        //  await goto("http://todomvc.com/examples/angularjs/#/");
        await goto("http://todomvc.com/examples/react/#/");
        await write("Working with examples",into(inputField({placeholder:"What needs to be done?"})));
        await press("Enter");
        await click("Working with examples");
        await click(checkBox(near("Working with examples")));
        await click("Clear completed");
    } catch (e) {
        console.error(e);
    } finally {
        await closeBrowser();
    }
})();

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

5 participants