-
Notifications
You must be signed in to change notification settings - Fork 20
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
O3 - 2199 : Add BDD steps on tests #40
base: main
Are you sure you want to change the base?
Conversation
@Piumal1999 @jayasanka-sack Please review this PR. |
@jayasanka-sack @Piumal1999 I do some updates and commit that on to this. please review this issue. |
e2e/specs/openConceptLab.spec.ts
Outdated
await test.step('And I unsubscribes', async () => { | ||
await openConceptLabPage.subscriptionTab().click(); | ||
await openConceptLabPage.unsubscribe(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to move this block into an afterEach
block. (maybe with another ticket)
await test.step('And I unsubscribes', async () => { | |
await openConceptLabPage.subscriptionTab().click(); | |
await openConceptLabPage.unsubscribe(); | |
}); | |
await openConceptLabPage.subscriptionTab().click(); | |
await openConceptLabPage.unsubscribe(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed since there's only one test case
@Piumal1999 I committed the suggestions. can you please review this? |
Hi @dilankavishka, |
a32bfb3
to
fa225e3
Compare
@Piumal1999 Done with the issue. can you please review this? |
e2e/specs/openConceptLab.spec.ts
Outdated
// Unsubscribe | ||
await openConceptLabPage.subscriptionTab().click(); | ||
await openConceptLabPage.unsubscribe(); | ||
await test.step('And I unsubscribes', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await test.step('And I unsubscribes', async () => { | |
await test.step('And I unsubscribe', async () => { |
e2e/specs/openConceptLab.spec.ts
Outdated
await openConceptLabPage.goto(); | ||
await openConceptLabPage.previousImportsTab().click(); | ||
await expect(openConceptLabPage.previousImportsTable()).toHaveText(/\d+ items fetched/); | ||
await test.step('Then the import results should appear in the test report', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await test.step('Then the import results should appear in the test report', async () => { | |
await test.step('Then the import results should appear in previous imports', async () => { |
@Piumal1999 Done with the suggestions. |
await test.step('And I unsubscribe', async () => { | ||
await openConceptLabPage.subscriptionTab().click(); | ||
await openConceptLabPage.unsubscribe(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to expect anything after performing this step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayasanka-sack
Do you mean that we can add "Click on that subscription tab" after this step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I mean, what we can expect after unsubscribing? A success message?
I think an extra "Then" step would be nice to have.
await openConceptLabPage.addOclSubscription(); | ||
await test.step('When I setup the subscription', async () => { | ||
await openConceptLabPage.goto(); | ||
await openConceptLabPage.addOclSubscription(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Piumal1999 @dilankavishka Since addOclSubscription
function isn't reused anywhere, I think it would be better to move things back to here from the page.
Then break down it in to steps.
ex:
- When I go to the "OCL module page"
- And I enter the subscription URL
- And I enter the token
- And I click the save button
- Then I should ....
- When I click on the import tab
- ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayasanka-sack Sure!
@@ -13,22 +13,26 @@ test.beforeEach(async ({ api }) => { | |||
test('should be able to setup a subscription and import concepts', async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test name should be renamed with the action. Check other repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayasanka-sack Sure!
This is very close, @dilankavishka. Do you have the bandwidth to wrap it up? |
Requirements
Summary
This PR enhances the existing End-to-End (E2E) tests by incorporating Behavior-Driven Development (BDD) steps using Gherkin syntax. The modifications utilize Playwright's test.step function to organize the test scenarios into well-defined steps, making the test suite more readable and aligned with BDD principles.
Screenshots
Updated changes.
None.
Issue
None.
Other
None.