@@ -29,14 +29,130 @@ export class AddClusterWebView extends WebViewForm {
2929 await this . enterWebView ( async ( webView ) => {
3030 const button = await this . getStartYourOpenshiftExperienceButton ( webView ) ;
3131 await button . click ( ) ;
32- } )
32+ } ) ;
33+ }
34+
35+ public async checkLearningButton ( ) : Promise < void > {
36+ await this . enterWebView ( async ( webView ) => {
37+ await this . getStartLearningButton ( webView ) ;
38+ } ) ;
39+ }
40+
41+ public async checkRosaButton ( ) : Promise < void > {
42+ await this . enterWebView ( async ( webView ) => {
43+ await this . getRosaButton ( webView ) ;
44+ } ) ;
3345 }
3446
3547 private async getCreateRefreshClusterButton ( webView : WebView ) : Promise < WebElement > {
36- return await webView . findWebElement ( By . xpath ( '//span [contains(text(),"Create/Refresh cluster")]' ) ) ;
48+ return await webView . findWebElement ( By . xpath ( '//* [contains(text(),"Create/Refresh cluster")]' ) ) ;
3749 }
3850
3951 private async getStartYourOpenshiftExperienceButton ( webView : WebView ) : Promise < WebElement > {
40- return await webView . findElement ( By . xpath ( '//span[contains(text(),"Start your OpenShift experience")]' ) ) ;
52+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Start your OpenShift experience")]' ) ) ;
53+ }
54+
55+ private async getStartLearningButton ( webView : WebView ) : Promise < WebElement > {
56+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Start Learning")]' ) ) ;
57+ }
58+
59+ private async getRosaButton ( webView : WebView ) : Promise < WebElement > {
60+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Create a ROSA cluster")]' ) ) ;
61+ }
62+ }
63+
64+ export class LocalClusterWebViewPage extends WebViewForm {
65+
66+ public constructor ( ) {
67+ super ( 'Add OpenShift Cluster' ) ;
68+ }
69+
70+ public async checkText ( ) : Promise < void > {
71+ await this . enterWebView ( async ( webView ) => {
72+ await this . getText ( webView ) ;
73+ } ) ;
74+ }
75+
76+ public async checkDownloadButton ( ) : Promise < void > {
77+ await this . enterWebView ( async ( webView ) => {
78+ await this . getDownloadButton ( webView ) ;
79+ } ) ;
80+ }
81+
82+ public async checkPathButton ( ) : Promise < void > {
83+ await this . enterWebView ( async ( webView ) => {
84+ await this . getPathButton ( webView ) ;
85+ } ) ;
86+ }
87+
88+ public async clickBack ( ) : Promise < void > {
89+ await this . enterWebView ( async ( webView ) => {
90+ const button = await this . getBackButton ( webView ) ;
91+ await button . click ( ) ;
92+ } )
93+ }
94+
95+ private async getText ( webView : WebView ) : Promise < WebElement > {
96+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Red Hat OpenShift Local brings a minimal OpenShift 4 cluster")]' ) ) ;
97+ }
98+
99+ private async getDownloadButton ( webView : WebView ) : Promise < WebElement > {
100+ return await webView . findWebElement ( By . xpath ( '//*[@role="button" and contains(text(),"Download OpenShift Local")]' ) ) ;
101+ }
102+
103+ private async getPathButton ( webView : WebView ) : Promise < WebElement > {
104+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Select Path")]' ) ) ;
105+ }
106+
107+ private async getBackButton ( webView : WebView ) : Promise < WebElement > {
108+ return await webView . findWebElement ( By . xpath ( '//button[contains(text(),"Back")]' ) ) ;
109+ }
110+ }
111+
112+ export class DevSandboxWebViewPage extends WebViewForm {
113+
114+ public constructor ( ) {
115+ super ( 'Add OpenShift Cluster' ) ;
116+ }
117+
118+ public async checkText ( ) : Promise < void > {
119+ await this . enterWebView ( async ( webView ) => {
120+ await this . getText ( webView ) ;
121+ } ) ;
122+ }
123+
124+ public async checkLoginButton ( ) : Promise < void > {
125+ await this . enterWebView ( async ( webView ) => {
126+ await this . getLoginButton ( webView ) ;
127+ } ) ;
128+ }
129+
130+ public async checkSignUpButton ( ) : Promise < void > {
131+ await this . enterWebView ( async ( webView ) => {
132+ await this . getSignUpButton ( webView ) ;
133+ } ) ;
134+ }
135+
136+ public async clickBack ( ) : Promise < void > {
137+ await this . enterWebView ( async ( webView ) => {
138+ const button = await this . getBackButton ( webView ) ;
139+ await button . click ( ) ;
140+ } )
141+ }
142+
143+ private async getText ( webView : WebView ) : Promise < WebElement > {
144+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"The sandbox provides you with a private OpenShift environment")]' ) ) ;
145+ }
146+
147+ private async getLoginButton ( webView : WebView ) : Promise < WebElement > {
148+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Login to Red Hat")]' ) ) ;
149+ }
150+
151+ private async getSignUpButton ( webView : WebView ) : Promise < WebElement > {
152+ return await webView . findWebElement ( By . xpath ( '//*[contains(text(),"Sign Up")]' ) ) ;
153+ }
154+
155+ private async getBackButton ( webView : WebView ) : Promise < WebElement > {
156+ return await webView . findWebElement ( By . xpath ( '//button[contains(text(),"Back")]' ) ) ;
41157 }
42158}
0 commit comments