-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite easy borrow e2e tests (#499)
* Uncomment files * Rewrite easy borrow tests * Explicitly set blockchain options for each test * Use newer block default block number * Update claim sky tests * Update easy borrow tests * Simplify success dialog checks * Simplify dialog success assets check
- Loading branch information
Showing
48 changed files
with
906 additions
and
985 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
74 changes: 34 additions & 40 deletions
74
packages/app/src/features/dialogs/collateral/CollateralDialog.PageObject.ts
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,44 +1,38 @@ | ||
// import { Page, expect } from '@playwright/test' | ||
import { TestContext } from '@/test/e2e/setup' | ||
import { testIds } from '@/ui/utils/testIds' | ||
import { expect } from '@playwright/test' | ||
import { CollateralSetting } from '../collateral/types' | ||
import { DialogPageObject } from '../common/Dialog.PageObject' | ||
|
||
// import { ActionsPageObject } from '@/features/actions/ActionsContainer.PageObject' | ||
// import { testIds } from '@/ui/utils/testIds' | ||
export class CollateralDialogPageObject extends DialogPageObject { | ||
constructor(testContext: TestContext<any>) { | ||
super({ testContext, header: /Collateral/ }) | ||
} | ||
|
||
// import { CollateralSetting } from '../collateral/types' | ||
// import { DialogPageObject } from '../common/Dialog.PageObject' | ||
// #region actions | ||
async setUseAsCollateralAction({ | ||
assetName, | ||
setting, | ||
}: { | ||
assetName: string | ||
setting: CollateralSetting | ||
}): Promise<void> { | ||
await this.actionsContainer.acceptAllActionsAction(1) | ||
|
||
// export class CollateralDialogPageObject extends DialogPageObject { | ||
// constructor(page: Page) { | ||
// super(page, /.*/) | ||
// this.region = this.locateDialogByHeader('Collateral') | ||
// } | ||
// assertion used for waiting | ||
if (setting === 'enabled') { | ||
await this.expectSetUseAsCollateralSuccessPage(assetName, 'enabled') | ||
} else { | ||
await this.expectSetUseAsCollateralSuccessPage(assetName, 'disabled') | ||
} | ||
} | ||
// #endregion actions | ||
|
||
// // #region actions | ||
// async setUseAsCollateralAction({ | ||
// assetName, | ||
// setting, | ||
// updateBrowserAndNextBlockTime, | ||
// }: { | ||
// assetName: string | ||
// setting: CollateralSetting | ||
// updateBrowserAndNextBlockTime: () => Promise<void> | ||
// }): Promise<void> { | ||
// const actionsContainer = new ActionsPageObject(this.locatePanelByHeader('Actions')) | ||
// await actionsContainer.acceptAllActionsAction(1, updateBrowserAndNextBlockTime) | ||
|
||
// // assertion used for waiting | ||
// if (setting === 'enabled') { | ||
// await this.expectSetUseAsCollateralSuccessPage(assetName, 'enabled') | ||
// } else { | ||
// await this.expectSetUseAsCollateralSuccessPage(assetName, 'disabled') | ||
// } | ||
// } | ||
// // #endregion actions | ||
|
||
// // #region assertions | ||
// async expectSetUseAsCollateralSuccessPage(assetName: string, setting: CollateralSetting): Promise<void> { | ||
// await expect(this.region.getByRole('heading', { name: 'Congrats, all done!' })).toBeVisible() | ||
// await expect(this.region.getByTestId(testIds.dialog.success)).toContainText(assetName) | ||
// await expect(this.region.getByTestId(testIds.dialog.success)).toContainText(`Collateral ${setting}`) | ||
// } | ||
// // #endregion assertions | ||
// } | ||
// #region assertions | ||
async expectSetUseAsCollateralSuccessPage(assetName: string, setting: CollateralSetting): Promise<void> { | ||
await expect(this.region.getByRole('heading', { name: 'Congrats, all done!' })).toBeVisible() | ||
await expect(this.region.getByTestId(testIds.dialog.success)).toContainText(assetName) | ||
await expect(this.region.getByTestId(testIds.dialog.success)).toContainText(`Collateral ${setting}`) | ||
} | ||
// #endregion assertions | ||
} |
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/ConvertStablesDialog.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/DaiToUsdc.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/DaiToUsds.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/UsdcToDai.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/UsdcToUsds.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/UsdsToDai.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/UsdsToUsdc.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/savings/deposit/e2e/mainnet/DepositDAI.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/savings/deposit/e2e/mainnet/DepositUSDC.test-e2e.ts
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
4 changes: 2 additions & 2 deletions
4
packages/app/src/features/dialogs/savings/deposit/e2e/mainnet/DepositUSDS.test-e2e.ts
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.