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

Need to track downloaded file instead of page source in spec/features/plans/exports_spec.rb #3179

Open
pengyin-shan opened this issue May 20, 2022 · 1 comment
Labels

Comments

@pengyin-shan
Copy link
Contributor

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.0.4 and 3.1.0

Expected behaviour:

The expect part of this rspec test is to check if the plan title is in the generated file (i.e. csv, pdf, HTML, text and docx).

Actual behaviour:

Currently we are using expect(page.source).to have_text(plan.title) to validate the content. But the page.source is actually the original download page instead of the generated content. (i.e. cabayra is not jumping to the downloaded content after the click_button 'Download Plan' action).

However, this test actually passes because the page title exists in the download page (shown as the header). So we got tests passed but fail to validate what we need.

Steps to reproduce:
you can run p page.source after the click_button 'Download Plan' to see the page source. Even after the button is clicked, the page is still the downloaded page

Please correct me if I misunderstand the idea of this test. I wonder if the same issue might also happen to some other tests.

@pengyin-shan
Copy link
Contributor Author

Verified again on Feb 2023 on v4.0.2. The problem is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant