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 · 3 comments

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

Copy link
Collaborator

LavrovArtem commented Dec 15, 2017

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

This comment has been minimized.

Copy link
Author

BendingBender commented Dec 18, 2017

Your workaround works fine, thank you.

@AlexanderMoskovkin

This comment has been minimized.

Copy link
Contributor

AlexanderMoskovkin commented Apr 11, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.