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

E2E pipeline, common hooks, test for request token #5318

Merged
merged 39 commits into from
Sep 20, 2023

Conversation

oskarleonard
Copy link
Contributor

@oskarleonard oskarleonard commented Sep 14, 2023

What was the problem?

This PR resolves #5080

How was it solved?

  1. Use hooks pattern instead of setWorldConstructor
    1. Add screenshoots in an after hook
    2. Close: browser, context and page in corresponding hooks
    3. Add the network to be used for 99% of the E2E tests
  2. Added a common step to easily set up an account (should be used in most features background)
  3. Added a feature test for Request Token
  4. Increased default test timeout to 10 seconds, same that we use for our API network request.

How was it tested?

Please be aware of that the test can sometimes fail if our E2E service network responds slowly. In that case, just rerun the test before starting to investigate why tests are failing.

Pass scenario

  1. Run the branch with yarn dev
  2. Run the E2E test in another terminal window/tab
    PW_BASE_URL=http://localhost:8080/# yarn run cucumber:playwright:open
  3. Expected: Tests should pass

Fail scenario

  1. Go to file RequestToken.feature
  2. Change And "lisk_mainchain"... to And "none_existing_text"...
  3. Run tests: PW_BASE_URL=http://localhost:8080/# yarn run cucumber:playwright:open
  4. Expected: Tests should fail and produce this folder e2e/assets/screenshots where you can see a screenshoot of the failed test.

@oskarleonard oskarleonard self-assigned this Sep 14, 2023
@oskarleonard oskarleonard changed the base branch from development to release/3.0.0 September 14, 2023 16:06
@oskarleonard oskarleonard marked this pull request as draft September 14, 2023 16:06
@oskarleonard oskarleonard marked this pull request as ready for review September 19, 2023 08:10
ikem-legend
ikem-legend previously approved these changes Sep 19, 2023
Feature: Request Token
Background: Add an account and navigate to wallet
Given I add an account with passphrase "peanut hundred pen hawk invite exclude brain chunk gadget wait wrong ready" password "Password1$" name 'test_acc'
Then I go to page "wallet"
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be

Suggested change
Then I go to page "wallet"
And I go to page "wallet"

since its an action not an assertion

And button with text 'Copy link' should be disabled
Given I type "10" in "amount"
Then button with text "Copy link" should be enabled
And I click on a button with text "Copy link"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be Given not And since it comes after an assertive phrase

Suggested change
And I click on a button with text "Copy link"
Given I click on a button with text "Copy link"

e2e/fixtures/page.mjs Outdated Show resolved Hide resolved
e2e/steps/RequestToken.mjs Outdated Show resolved Hide resolved
e2e/hooks/hooks.mjs Outdated Show resolved Hide resolved
@eniolam1000752
Copy link
Contributor

the CI is red

@oskarleonard oskarleonard merged commit 6d10ab8 into release/3.0.0 Sep 20, 2023
6 checks passed
@oskarleonard oskarleonard deleted the 5080-e2e-request-token branch September 20, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E2E pipeline, common hooks, test for request token
4 participants