-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #833 from facebookresearch/add-tests-to-tips-example
Add tests to tips example
- Loading branch information
Showing
16 changed files
with
9,011 additions
and
8,299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
8 changes: 8 additions & 0 deletions
8
examples/static_react_task_with_tips/webapp/cypress.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
video: false, | ||
|
||
e2e: { | ||
baseUrl: "http://localhost:3000/?worker_id=x&assignment_id=1", | ||
includeShadowDom: true, | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
...p/cypress/e2e/post_submission_tests/static_react_task_with_tips_post_tip_submission.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { tipClassNamePrefix } from "../../helper"; | ||
describe("Checking for tips", () => { | ||
/* | ||
This test is supposed to be ran after running the pre_tip_submission cypress test. | ||
The pre_tip_submission cypress test submits three tips for reviewing. | ||
Before running this test, you should review the tips for static_react_task_with_tips | ||
by running python review_tips_for_task.py. | ||
To pass this test, accept the first tip and reject the other two. | ||
Then run this test and it should pass. | ||
The whole process is gone through in the cypress-end-to-end-tests.yml github actions file. | ||
*/ | ||
it("Checks for recently added tip", () => { | ||
cy.visit("/"); | ||
cy.get(`.${tipClassNamePrefix}button`).as("tipsButton"); | ||
cy.get("@tipsButton").click(); | ||
|
||
cy.get(`.${tipClassNamePrefix}tip`).eq(-1).as("lastTip"); | ||
|
||
cy.get("@lastTip").find("h2").as("lastTipHeader"); | ||
cy.get("@lastTip").find("p").as("lastTipBody"); | ||
|
||
cy.get("@lastTipHeader").should( | ||
"have.text", | ||
"🎉 This is my test tip header" | ||
); | ||
cy.get("@lastTipBody").should("have.text", "🎈 This is my test tip body"); | ||
}); | ||
}); |
Oops, something went wrong.