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

AngularJS (1.6) app loads twice on each test start due to hash fragment changes #2005

Closed
BendingBender opened this issue Dec 14, 2017 · 4 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@BendingBender
Copy link

BendingBender commented Dec 14, 2017

Are you requesting a feature or reporting a bug?

Reporting a bug

What is the current behavior?

Every time a test starts, the app loads, testcafe starts typing into an input field, then app reloads. Testcafe doesn't seem to notice the reload and continues typing into next input field without noticing that the first input field is empty due to full page reload.

This happens due to AngularJS' 1.6 way of attaching a hash fragment (#/) to the app url on load for in-app routing. When just the official url (https://app.treefin.com) is used to run the tests the app is being reloaded directly after test start. When we extend the url with the hash fragment (https://app.treefin.com/#/) and use it to run the tests no unnecessary reloads are performed.

What is the expected behavior?

App shouldn't be fully reloaded just because of a hash fragment change. Browsers don't reload on fragment changes, neither should testcafe.

How would you reproduce the current behavior (if this is a bug)?

Load our page with the provided code.

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://app.treefin.com

Test code

fixture`Login page`.page`https://app.treefin.com`;

test('Login button enabled when complex password is entered', async (t) => {
    await t
        .typeText(Selector('#mview-login input[type="email"]'), 'some@email.com')
        .typeText(Selector('#mview-login input[type="password"]'), '1123sssAAA--')
        .expect(Selector('#mview-login button[type="submit"]').getAttribute('disabled'))
        .eql(undefined, 'login button must be enabled when complex password is entered');
});

Specify your

  • operating system: Mac OS 10.13.2
  • testcafe version: 0.18.5
  • node.js version: 8.9.0
@LavrovArtem
Copy link
Contributor

Hi @BendingBender,
I have investigated this issue and found a problem into our proxy server.
As workaraund add a slash after host:
.page`https://app.treefin.com -> .page`https://app.treefin.com/

@BendingBender
Copy link
Author

Your workaround works fine, thank you.

@AlexanderMoskovkin
Copy link
Contributor

Fixed in hammerhead@13.3.1. The fix will be available in testcafe@0.19.2 (it's already available in testcafe@0.19.2-alpha3)

@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: hammerhead TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

4 participants