Testcafe: Testcafe doesn't handle state/url in Ionic/Angularjs app with tabs

Created on 21 Mar 2018  路  10Comments  路  Source: DevExpress/testcafe

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

In a tab with more than one view (for example, the default Ionic "tabs" app) (https://ionicframework.com/getting-started/), the browser history is not maintained correctly during "back" operations. For example, in the Ionic-supplied default app, if the test visits the "chats" tab, then visits the chat labeled "Ben Sparrow", then hits the "< Chats" button to return to the previous page, testcafe returns to the home "Status" tab rather than the "Chats" tab, as interactive usage would do.

What is the expected behavior?

testcafe should maintain appropriate view history so that buttons return to the proper state.

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

To install the default Ionic app, do:
ionic start tabTest tabs --type ionic1

Run the app with 'ionic serve'

Then create the following test (you may need to adjust the port number below to 8100 or similar):

import { Role, Selector } from 'testcafe';
import { AngularJSSelector } from 'testcafe-angular-selectors';

const span = Selector('span');
const a = Selector('a');
const button = Selector('button');

fixture `Getting Started`
    .page `http://localhost:8101/`;

test('Browse test', async t => {
    await t
    .click(span.withText('Chats').parent())
    .click(a.withText('Ben Sparrow'))
    .click(button.withText('Chats'))
    .click(a.withText('Ben Sparrow'))
});

The last click on 'Ben Sparrow' will fail because the test is on the incorrect page, it has returned to the home state rather than returning to the previous view of Chats tab, as interactive usage will do.

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

Tested page URL:

Test code


Specify your

  • operating system: MacOS High Sierra 10.13.3
  • testcafe version: 0.19.1
  • node.js version: v8.9.4
Auto-locked hammerhead bug

All 10 comments

Hi @viking2917
I've reproduced the issue. I need additional time to investigate the cause of the problem.

I'm working on it

Thank you! What is the best way for me to get the fix? Simply re-install testcafe? Or do I need to wait for a release?

Hi, we will publish a new version of TestCafe with the fix the next week. It can take a couple of days after the weekend. We will let you know when it's done. Thanks for your cooperation.

will be traveling for a bit but will give it a try when I return, thanks!

I can confirm this works now, after re-installing testcafe. Thank you!

@viking2917 Hello, "twice click" test failed in Edge / Windows 10 / TestCafe 0.19.2. Could you please specify your browser/OS configuration, it's Safari / Mac OS X 10.13.3 / TestCafe 0.19.2?

@Farfurix Sorry I am an idiot. I had a local installation of testcafe 0.19.1 covering an installation of 0.19.2. When I removed that and made sure to have 0.19.2 everything works. Thanks!

@viking2917 Thanks for your feedback, I'm glad that the problem is solved.

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.

Was this page helpful?
0 / 5 - 0 ratings