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

Add e2e tests #206

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Add e2e tests #206

wants to merge 5 commits into from

Conversation

gertie-sheshe
Copy link
Contributor

@gertie-sheshe gertie-sheshe commented Dec 13, 2020

Description

Adding end to end tests

Fixes #175888269

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Desktop Screenshots

Screenshot 2020-12-14 at 00 45 16

Mobile Screenshots

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@gertie-sheshe gertie-sheshe self-assigned this Dec 13, 2020
@vercel
Copy link

vercel bot commented Dec 13, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/codeforafrica/promisetracker/1661nl9o8
✅ Preview: https://promisetracker-git-chore-tests.codeforafrica.now.sh

@gertie-sheshe gertie-sheshe added the chore Change that improve code but doesn't add any feature label Dec 14, 2020
@gertie-sheshe gertie-sheshe marked this pull request as ready for review January 6, 2021 06:48
Copy link
Member

@kilemensi kilemensi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏾 @gertie-sheshe .

How do we automate the testing then i.e. how do we make sure (all) tests run and pass whenever a new PR is created/before a PR is merged to main?

describe("Act Now page", () => {
it("renders Act Now page", () => {
cy.visit("/");
cy.get("[data-cy=navigation-buttons]").contains("Act Now").click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we modified the navigation buttons to contain data-cy=navigation-buttons? This fails when I run locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The fail is probably from a timeout issue

@@ -0,0 +1,25 @@
// ***********************************************
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need empty files like these?

Comment on lines +46 to +52
it("filter stalled promises", () => {
cy.get("[data-cy=promises-section]")
.find("img")
.its("length")
.then((length) => {
expect(length).to.equal(5);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm getting this correct, it means everytime the PromiseTracker team add/remove promises in Check, these tests will fail. Correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisely. That's the problem I have at the moment, since I am using production database it is bound to change any time. And how to mock that data is a challenge on Cypress as it runs on the client side and the pages are SSR - so they already come with the data.

@gertie-sheshe gertie-sheshe marked this pull request as draft February 9, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Change that improve code but doesn't add any feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants