-
Notifications
You must be signed in to change notification settings - Fork 13
test: add test for discover midnight banner [LW-13628] #2004
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1e4efee
test: add test for LW-13628 discover midnight banner
tr-io-global 5617f1c
test: add test for LW-13628 discover midnight banner, update assert
tr-io-global 7ec14db
test: add test for LW-13628 discover midnight banner, move steps from…
tr-io-global 6f47436
test: add test for LW-13628 discover midnight banner, updates
tr-io-global 162a4d0
test: add test for LW-13628 discover midnight banner, update variable…
tr-io-global 510e064
Merge branch 'main' into test/LW-13628-discover-midnight-banner
tr-io-global f00223e
test: add test for LW-13628 discover midnight banner, fix test file path
tr-io-global 1d2e295
Merge branch 'main' into test/LW-13628-discover-midnight-banner
tr-io-global f995bc3
Merge branch 'main' into test/LW-13628-discover-midnight-banner
tr-io-global File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,25 @@ | ||
import { expect } from 'chai'; | ||
import { t } from '../utils/translationService'; | ||
import midnightBanner from '../elements/midnightBanner'; | ||
|
||
class MidnightBannerAssert { | ||
async assertSeeMidnightBanner() { | ||
await midnightBanner.title.waitForDisplayed(); | ||
expect(await midnightBanner.title.getText()).to.equal(await t('midnightEventBanner.title')); | ||
await midnightBanner.closeButton.waitForDisplayed(); | ||
await midnightBanner.bannerDescriptionText.waitForDisplayed(); | ||
expect(await midnightBanner.bannerDescriptionText.getText()).to.equal(await t('midnightEventBanner.description')); | ||
await midnightBanner.learnMoreButton.waitForDisplayed(); | ||
expect(await midnightBanner.learnMoreButton.getText()).to.equal(await t('midnightEventBanner.learnMore')); | ||
await midnightBanner.remindMeLaterButton.waitForDisplayed(); | ||
expect(await midnightBanner.remindMeLaterButton.getText()).to.equal(await t('midnightEventBanner.reminder')); | ||
} | ||
|
||
async assertSeeMidnightURL() { | ||
const EXPECTED_MIDNIGHT_URL = 'https://www.midnight.gd'; | ||
const currentUrl = await browser.getUrl(); | ||
expect(currentUrl).to.contain(EXPECTED_MIDNIGHT_URL); | ||
} | ||
} | ||
|
||
export default new MidnightBannerAssert(); |
This file contains hidden or 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,36 @@ | ||
/* global WebdriverIO */ | ||
import { ChainablePromiseElement } from 'webdriverio'; | ||
|
||
class MidnightBanner { | ||
private readonly TITLE = '[data-testid="midnight-event-banner-title"]'; | ||
private readonly LEARN_MORE_BUTTON = '[data-testid="learn-more-button-extended"]'; | ||
private readonly REMIND_ME_LATER_BUTTON = '[data-testid="remind-me-later-button-extended"]'; | ||
private readonly CLOSE_BUTTON = '[data-testid="midnight-event-banner-close-button"]'; | ||
private readonly BANNER_DESCRIPTION_TEXT = '[data-testid="midnight-event-banner-description"]'; | ||
|
||
get title(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.TITLE); | ||
} | ||
|
||
get learnMoreButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.LEARN_MORE_BUTTON); | ||
} | ||
get closeButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.CLOSE_BUTTON); | ||
} | ||
|
||
get bannerDescriptionText(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.BANNER_DESCRIPTION_TEXT); | ||
} | ||
|
||
get remindMeLaterButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $(this.REMIND_ME_LATER_BUTTON); | ||
} | ||
|
||
async clickOnLearnMoreButton() { | ||
await this.learnMoreButton.waitForClickable(); | ||
await this.learnMoreButton.click(); | ||
} | ||
} | ||
|
||
export default new MidnightBanner(); |
This file contains hidden or 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,12 @@ | ||
@Midnight-Banner @Testnet | ||
|
||
Feature: Midnight - banner view | ||
|
||
Background: | ||
Given Wallet is synced | ||
|
||
@LW-13628 | ||
Scenario: "Discover the Midnight Token Distribution" banner - click on "Learn more" button | ||
Given "Discover the Midnight Token Distribution" banner is displayed | ||
When I click on "Learn more" button on "Discover the Midnight Token Distribution" banner | ||
Then "www.midnight.gd" page is displayed in new tab |
This file contains hidden or 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 hidden or 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,17 @@ | ||
import { Given, When, Then } from '@cucumber/cucumber'; | ||
import midnightBanner from '../elements/midnightBanner'; | ||
import midnightBannerAssert from '../assert/midnightBannerAssert'; | ||
import { switchToLastWindow } from '../utils/window'; | ||
|
||
Given(/^"Discover the Midnight Token Distribution" banner is displayed$/, async () => { | ||
await midnightBannerAssert.assertSeeMidnightBanner(); | ||
}); | ||
|
||
When(/^I click on "Learn more" button on "Discover the Midnight Token Distribution" banner$/, async () => { | ||
await midnightBanner.clickOnLearnMoreButton(); | ||
}); | ||
|
||
Then(/^"www.midnight.gd" page is displayed in new tab$/, async () => { | ||
await switchToLastWindow(); | ||
await midnightBannerAssert.assertSeeMidnightURL(); | ||
}); |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.