@@ -2,6 +2,7 @@ import {InternetIdentityPage} from '@dfinity/internet-identity-playwright';
22import { notEmptyString } from '@dfinity/utils' ;
33import { PrincipalText , PrincipalTextSchema } from '@dfinity/zod-schemas' ;
44import { expect } from '@playwright/test' ;
5+ import { TIMEOUT_AVERAGE , TIMEOUT_SHORT } from '../constants/e2e.constants' ;
56import { testIds } from '../constants/test-ids.constants' ;
67import { IdentityPage , type IdentityPageParams } from './identity.page' ;
78import { SatellitePage } from './satellite.page' ;
@@ -48,13 +49,31 @@ export class ConsolePage extends IdentityPage {
4849 await this . #consoleIIPage. waitReady ( { url : CONTAINER_URL , canisterId : INTERNET_IDENTITY_ID } ) ;
4950 }
5051
51- async createSatellite ( { kind} : { kind : 'website' | 'application' } ) : Promise < void > {
52- await expect ( this . page . getByTestId ( testIds . createSatellite . launch ) ) . toBeVisible ( {
53- timeout : 20000
54- } ) ;
52+ async createSatellite ( params : { kind : 'website' | 'application' } ) : Promise < void > {
53+ await expect ( this . page . getByTestId ( testIds . launchpad . launch ) ) . toBeVisible ( TIMEOUT_AVERAGE ) ;
54+
55+ await this . page . getByTestId ( testIds . launchpad . launch ) . click ( ) ;
56+
57+ await this . createSatelliteWizard ( params ) ;
58+ }
59+
60+ async openCreateAdditionalSatelliteWizard ( params : {
61+ kind : 'website' | 'application' ;
62+ } ) : Promise < void > {
63+ await expect ( this . page . getByTestId ( testIds . launchpad . actions ) ) . toBeVisible ( TIMEOUT_AVERAGE ) ;
5564
56- await this . page . getByTestId ( testIds . createSatellite . launch ) . click ( ) ;
65+ await this . page . getByTestId ( testIds . launchpad . actions ) . click ( ) ;
5766
67+ await expect ( this . page . getByTestId ( testIds . launchpad . launchExtraSatellite ) ) . toBeVisible (
68+ TIMEOUT_AVERAGE
69+ ) ;
70+
71+ await this . page . getByTestId ( testIds . launchpad . launchExtraSatellite ) . click ( ) ;
72+
73+ await this . createSatelliteWizard ( params ) ;
74+ }
75+
76+ private async createSatelliteWizard ( { kind} : { kind : 'website' | 'application' } ) : Promise < void > {
5877 await expect ( this . page . getByTestId ( testIds . createSatellite . create ) ) . toBeVisible ( {
5978 timeout : 15000
6079 } ) ;
@@ -64,19 +83,19 @@ export class ConsolePage extends IdentityPage {
6483
6584 await this . page . getByTestId ( testIds . createSatellite . create ) . click ( ) ;
6685
67- await expect ( this . page . getByTestId ( testIds . createSatellite . continue ) ) . toBeVisible ( {
68- timeout : 20000
69- } ) ;
86+ await expect ( this . page . getByTestId ( testIds . createSatellite . continue ) ) . toBeVisible (
87+ TIMEOUT_AVERAGE
88+ ) ;
7089
7190 await this . page . getByTestId ( testIds . createSatellite . continue ) . click ( ) ;
7291 }
7392
7493 async visitSatelliteSite (
7594 { title} : { title : string } = { title : 'Juno / Satellite' }
7695 ) : Promise < SatellitePage > {
77- await expect ( this . page . getByTestId ( testIds . satelliteOverview . visit ) ) . toBeVisible ( {
78- timeout : 20000
79- } ) ;
96+ await expect ( this . page . getByTestId ( testIds . satelliteOverview . visit ) ) . toBeVisible (
97+ TIMEOUT_AVERAGE
98+ ) ;
8099
81100 const satellitePagePromise = this . context . waitForEvent ( 'page' ) ;
82101
@@ -93,16 +112,16 @@ export class ConsolePage extends IdentityPage {
93112 } ) ;
94113 }
95114
96- async getICP ( ) : Promise < void > {
115+ async getCycles ( ) : Promise < void > {
97116 await expect ( this . page . getByTestId ( testIds . navbar . openWallet ) ) . toBeVisible ( ) ;
98117
99118 await this . page . getByTestId ( testIds . navbar . openWallet ) . click ( ) ;
100119
101- await expect ( this . page . getByTestId ( testIds . navbar . getIcp ) ) . toBeVisible ( ) ;
120+ await expect ( this . page . getByTestId ( testIds . navbar . getCycles ) ) . toBeVisible ( ) ;
102121
103- await this . page . getByTestId ( testIds . navbar . getIcp ) . click ( ) ;
122+ await this . page . getByTestId ( testIds . navbar . getCycles ) . click ( ) ;
104123
105- await expect ( this . page . getByText ( '55.0001 ' ) ) . toBeVisible ( { timeout : 65000 } ) ;
124+ await expect ( this . page . getByText ( '330.010 T Cycles ' ) ) . toBeVisible ( { timeout : 65000 } ) ;
106125 }
107126
108127 async copySatelliteID ( ) : Promise < string > {
@@ -128,7 +147,7 @@ export class ConsolePage extends IdentityPage {
128147 await this . goto ( { path : `/satellite/?s=${ satelliteId } &tab=setup` } ) ;
129148
130149 const btnLocator = this . page . locator ( 'button' , { hasText : 'Add an access key' } ) ;
131- await expect ( btnLocator ) . toBeVisible ( { timeout : 10000 } ) ;
150+ await expect ( btnLocator ) . toBeVisible ( TIMEOUT_SHORT ) ;
132151 await btnLocator . click ( ) ;
133152
134153 const form = this . page . locator ( 'form' ) ;
@@ -145,6 +164,6 @@ export class ConsolePage extends IdentityPage {
145164 await expect ( submitLocator ) . toBeEnabled ( ) ;
146165 await submitLocator . click ( ) ;
147166
148- await expect ( this . page . getByText ( 'Access Key Added' ) ) . toBeVisible ( { timeout : 10000 } ) ;
167+ await expect ( this . page . getByText ( 'Access Key Added' ) ) . toBeVisible ( TIMEOUT_SHORT ) ;
149168 }
150169}
0 commit comments