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

In a Polymer SPA there are complete reloads between each test #1509

Closed
iexplore opened this issue Jun 1, 2017 · 6 comments
Closed

In a Polymer SPA there are complete reloads between each test #1509

iexplore opened this issue Jun 1, 2017 · 6 comments
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. STATE: Duplicate An issues has been already reported in the other thread. TYPE: enhancement The accepted proposal for future implementation.

Comments

@iexplore
Copy link

iexplore commented Jun 1, 2017

I am a newby on testcafe so it might be ignorance on my part.

When loading a Polymer SPA I am using fixture.page('http...) to initialize the app.
Unfortunately the page is reloaded (and therefor the SPA is reinitialized) between each test.
This is of course not what you want in a SPA but I can't find how to prevent this behavior.

@AlexanderMoskovkin AlexanderMoskovkin added the TYPE: question The issue contains a question that won't be addressed. label Jun 1, 2017
@AlexanderMoskovkin AlexanderMoskovkin self-assigned this Jun 1, 2017
@AlexanderMoskovkin
Copy link
Contributor

Hi,
 
Each test is an independent unit that opens a page, does some actions and assertions and closes the page. Each test can change the page state. At the same time, each test should start from a determined state to be independent from others (otherwise, you can't run each test separately). That's why each page starts with a new page.
If you have some common actions that should be executed in each test, you can use fixture hooks or User Roles if you need to be logged in for each test.

@iexplore
Copy link
Author

iexplore commented Jun 1, 2017

Hi @AlexanderMoskovkin,

I can certainly understand that you want a clean test environment the have a clear picture of what get's tested, but if you are working with an single page application (SPA) you definitely don't want to reset the application between tests. You want to be able to jump from one page (or situation) to another and stay in the application. I use the fixture hook to logon but I am afraid this does not solve the problem.

As alternative doing everything in one big test would mean building very large test functions that test a lot of situations. Moreover you cannot see the test steps and if something is wrong the whole testing is stopped.

I am new with e2e browser testing and I don't know if Selenium works the same way (because I much prefer the power and simplicity of TestCafe), but I don't see how to setup a good working test script this way.

@AlexanderMoskovkin AlexanderMoskovkin added TYPE: proposal and removed TYPE: question The issue contains a question that won't be addressed. labels Jun 1, 2017
@AlexanderMoskovkin
Copy link
Contributor

I understand you point, it makes sense. We should consider an ability to add some option that switch on a mode where the page state is not completely reset between tests (like just calling navigateTo action)

@iexplore
Copy link
Author

iexplore commented Jun 1, 2017

Yes, exactly.

I am not sure what is happening between tests (next to page reloads), but in this situation nothing should change.

For instance an option on fixture level (something like noReloadBetweenTests).
On Test level it is probably not necessary to create an override for this behavior because you can start with test.page('http...') to do a reload.

@AlexanderMoskovkin AlexanderMoskovkin added the STATE: Duplicate An issues has been already reported in the other thread. label Sep 7, 2017
@AlexanderMoskovkin
Copy link
Contributor

closed in favor of the #1770

@AndreyBelym AndreyBelym added the TYPE: enhancement The accepted proposal for future implementation. label Feb 6, 2019
@lock
Copy link

lock bot commented Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 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. STATE: Duplicate An issues has been already reported in the other thread. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

3 participants