-
Notifications
You must be signed in to change notification settings - Fork 9
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 #2572 from IntersectMBO/refactor/test-structure
Refactor test suite: Automated Testing Strategy for Mainnet with ADA-Free Scenarios
- Loading branch information
Showing
30 changed files
with
350 additions
and
272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import DRepDirectoryPage from "@pages/dRepDirectoryPage"; | ||
import { Page } from "@playwright/test"; | ||
|
||
export async function fetchFirstActiveDRepDetails(page: Page) { | ||
let dRepGivenName: string; | ||
let dRepId: string; | ||
let dRepDirectoryPage: DRepDirectoryPage; | ||
await page.route( | ||
"**/drep/list?page=0&pageSize=10&sort=Random&**", | ||
async (route) => { | ||
const response = await route.fetch(); | ||
const json = await response.json(); | ||
const elements = json["elements"].filter( | ||
(element) => element["givenName"] != null | ||
); | ||
dRepGivenName = | ||
elements[Math.floor(Math.random() * elements.length)]["givenName"]; | ||
dRepId = json["elements"][0]["view"]; | ||
await route.fulfill({ | ||
status: 200, | ||
contentType: "application/json", | ||
body: JSON.stringify(json), | ||
}); | ||
} | ||
); | ||
|
||
const responsePromise = page.waitForResponse( | ||
"**/drep/list?page=0&pageSize=10&sort=Random&**" | ||
); | ||
|
||
dRepDirectoryPage = new DRepDirectoryPage(page); | ||
await dRepDirectoryPage.goto(); | ||
await dRepDirectoryPage.filterBtn.click(); | ||
await page.getByTestId("Active-checkbox").click(); | ||
await responsePromise; | ||
|
||
await dRepDirectoryPage.searchInput.click(); | ||
return { dRepGivenName, dRepId, dRepDirectoryPage }; | ||
} |
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
Oops, something went wrong.