Bug
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.
testcafe should maintain appropriate view history so that buttons return to the proper state.
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.
Tested page URL:
Test code
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.