-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for rewards campaign creation + some improvments (#933)
* Added tests for switching networks and more swapping (#896) * Added tests for swapping * Added tests for swapping * Transaction Settings Smoke Test * Small fix for improving stability of the tests * Small fix for improving stability of the tests * Added tests for swaping * Small fix for improving stability of the tests * Added tests for wallet connection * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks Co-authored-by: MilanVojnovic95 <mv.coversproduction@gmail.com> * Tests for creating a campaign (#929) * Added tests for swapping * Added tests for swapping * Transaction Settings Smoke Test * Small fix for improving stability of the tests * Small fix for improving stability of the tests * Added tests for swaping * Fix showing avatar without an image * Small fix for improving stability of the tests * Added tests for wallet connection * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * fix: hide unsupported net popup * fix: remove whitespace * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added tests for switching networks and more swapping (#896) (#902) * Added tests for swapping * Added tests for swapping * Transaction Settings Smoke Test * Small fix for improving stability of the tests * Small fix for improving stability of the tests * Added tests for swaping * Small fix for improving stability of the tests * Added tests for wallet connection * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks * Added test for switching networks Co-authored-by: MilanVojnovic95 <mv.coversproduction@gmail.com> Co-authored-by: MilanVojnovic95 <mv.coversproduction@gmail.com> * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation * Added test for liquidity campaign creation Co-authored-by: MilanVojnovic95 <mv.coversproduction@gmail.com> Co-authored-by: Diogo <diogo.mart.ferreira@gmail.com> Co-authored-by: Oskar Karcz <oskar.karcz@rumblefish.pl> Co-authored-by: Adam Azad <adam@adamazad.com> Co-authored-by: karczuRF <88723742+karczuRF@users.noreply.github.com> * Small fixes along with name changes, added possibility to add cypress plugins to synpress * Fix for opening reward card * Fix for opening reward card * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr * Fixes from cr Co-authored-by: MilanVojnovic95 <mv.coversproduction@gmail.com> Co-authored-by: Diogo <diogo.mart.ferreira@gmail.com> Co-authored-by: Oskar Karcz <oskar.karcz@rumblefish.pl> Co-authored-by: Adam Azad <adam@adamazad.com> Co-authored-by: karczuRF <88723742+karczuRF@users.noreply.github.com>
- Loading branch information
1 parent
91f9042
commit d1ce4fc
Showing
34 changed files
with
514 additions
and
153 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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export class CampaignPage { | ||
static getCampaignTokensText() { | ||
return cy.get('[data-testid=campaign-tokens]') | ||
} | ||
static getCampaignStatusText(specifiedTimout = 30000) { | ||
return cy.get('[data-testid=campaign-status]', { timeout: specifiedTimout }) | ||
} | ||
static getCampaignStartDateText() { | ||
return cy.get('[data-testid=start-date]') | ||
} | ||
static getCampaignEndDateText() { | ||
return cy.get('[data-testid=end-date]') | ||
} | ||
static getCampaignRewardsBox() { | ||
return cy.get('[data-testid=rewards-box]') | ||
} | ||
static checkCampaignData( | ||
tokenPair: string, | ||
rewardsInput: number, | ||
campaignStatus: string, | ||
startsAt: string, | ||
endsAt: string | ||
) { | ||
CampaignPage.getCampaignTokensText().should('contain.text', tokenPair) | ||
CampaignPage.getCampaignRewardsBox().should('contain.text', rewardsInput) | ||
CampaignPage.getCampaignStatusText(90000).should('contain.text', campaignStatus) | ||
CampaignPage.getCampaignStartDateText().should('contain.text', startsAt) | ||
CampaignPage.getCampaignEndDateText().should('contain.text', endsAt) | ||
return cy.get('[data-testid=rewards-box]') | ||
} | ||
} |
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,28 @@ | ||
export class CreatePoolPage { | ||
static getLiquidityPairMenuButton() { | ||
return cy.get('[data-testid=liquidity-pair-select]') | ||
} | ||
static getRewardTokenMenuButton() { | ||
return cy.get('[data-testid=reward-token-select]') | ||
} | ||
static getTotalRewardInput() { | ||
return cy.get('[data-testid=reward-input]') | ||
} | ||
static getConfirmButton() { | ||
return cy.get('[data-testid=confirm-button]') | ||
} | ||
static setStartTime(time: string) { | ||
return cy.get('[data-testid=start-time-selector-box]').within(() => { | ||
cy.get('.react-datepicker__input-container').type(time) | ||
}) | ||
} | ||
static setEndTime(time: string) { | ||
return cy.get('[data-testid=end-time-selector-box]').within(() => { | ||
cy.get('.react-datepicker__input-container').type(time) | ||
}) | ||
} | ||
static confirmPoolCreation() { | ||
this.getConfirmButton().click() | ||
cy.get('[data-testid=modal-confirm-button]').click() | ||
} | ||
} |
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
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 @@ | ||
export class PairMenu { | ||
static getSearchPairInput() { | ||
return cy.get('[data-testid=search-pair]') | ||
} | ||
static choosePair(pairName: string) { | ||
return this.getSearchPairInput().type(pairName + '{enter}{enter}', { delay: 100 }) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,64 @@ | ||
import { getUnixTime } from 'date-fns' | ||
import { PairMenu } from './PairMenu' | ||
|
||
export class RewardsPage { | ||
static visitRewardsPage() { | ||
cy.visit('/#/rewards') | ||
} | ||
|
||
static getActiveCampaignsButton() { | ||
return cy.get('[data-testid=active-campaigns]') | ||
} | ||
|
||
static getExpiredCampaignsButton() { | ||
return cy.get('[data-testid=expired-campaigns]') | ||
} | ||
|
||
static getCreateCampaignButton() { | ||
return cy.get('[data-testid=create-campaign]') | ||
} | ||
|
||
static getAllPairsButton() { | ||
return cy.get('[data-testid=all-pairs]') | ||
} | ||
|
||
static getSearchAPairModalWindow() { | ||
return cy.get('[data-testid=select-a-pair]') | ||
} | ||
|
||
static getSearchAPairField() { | ||
return cy.get('[data-testid=search-pair]') | ||
} | ||
|
||
static getCloseSearchAPairModalWindowButton() { | ||
return cy.get('[data-testid=close-search-pair]') | ||
} | ||
|
||
static getMyPairsToggleSwitch() { | ||
return cy.get('.react-switch-button') | ||
} | ||
static getRewardCard() { | ||
return cy.get('[data-testid=ended-campaign]') | ||
|
||
static getRewardCards() { | ||
return cy.get('[data-testid=reward-card]') | ||
} | ||
|
||
static getRewardCardByStartingAt(startingAt: string) { | ||
return cy.get('[data-testid=reward-starting-at-' + startingAt + ']', { timeout: 60000 }) | ||
} | ||
|
||
static clickOnRewardCardUntilCampaignOpen(startingAt: Date, chosenPair = '') { | ||
cy.waitUntil(() => { | ||
if (Cypress.$('[data-testid=reward-card]').length) { | ||
//TODO After opening campaign for first time it instead of opening reward card opens all rewards page | ||
if (chosenPair != '') { | ||
RewardsPage.getAllPairsButton().click() | ||
PairMenu.choosePair(chosenPair) | ||
} | ||
return RewardsPage.getRewardCardByStartingAt(getUnixTime(startingAt).toString()) | ||
.click() | ||
.then(() => false) | ||
} | ||
return true | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.