@@ -54,6 +54,57 @@ func ClusterStatusFromList(clustersPage *pages.ClustersPage, clusterName string)
54
54
return pages .FindClusterInList (clustersPage , clusterName ).Status
55
55
}
56
56
57
+ func deleteClusterEntry (webDriver * agouti.Page , clusterNames []string ) {
58
+ for _ , clusterName := range clusterNames {
59
+ clustersPage := pages .GetClustersPage (webDriver )
60
+ clusterConnectionPage := pages .GetClusterConnectionPage (webDriver )
61
+ confirmDisconnectClusterDialog := pages .GetConfirmDisconnectClusterDialog (webDriver )
62
+
63
+ log .Printf ("Deleting cluster entry: %s" , clusterName )
64
+ Expect (webDriver .Refresh ()).ShouldNot (HaveOccurred ())
65
+
66
+ By ("And wait for the page to be fully loaded" , func () {
67
+ Eventually (clustersPage .SupportEmailLink ).Should (BeVisible ())
68
+ Eventually (clustersPage .ClusterCount ).Should (MatchText (`[0-9]+` ))
69
+ Eventually (clustersPage .ClustersListSection ).Should (BeFound ())
70
+ pages .ScrollWindow (webDriver , WINDOW_SIZE_X , WINDOW_SIZE_Y )
71
+ })
72
+
73
+ By ("And when I click edit cluster I should see disconnect cluster tab" , func () {
74
+
75
+ if len (clusterName ) > 256 {
76
+ clusterName = clusterName [0 :256 ]
77
+ }
78
+ Expect (pages .FindClusterInList (clustersPage , clusterName ).EditCluster .Click ()).To (Succeed ())
79
+
80
+ Eventually (clusterConnectionPage .ClusterConnectionPopup ).Should (BeFound ())
81
+ Eventually (clusterConnectionPage .DisconnectTab ).Should (BeFound ())
82
+ })
83
+
84
+ By ("And I open Disconnect tab and click Remove cluster from the MCCP button" , func () {
85
+ Expect (clusterConnectionPage .DisconnectTab .Click ()).Should (Succeed ())
86
+
87
+ Eventually (clusterConnectionPage .ButtonRemoveCluster ).Should (BeFound ())
88
+ Expect (clusterConnectionPage .ButtonRemoveCluster .Click ()).To (Succeed ())
89
+ })
90
+
91
+ By ("Then I should see an alert popup with Remove button" , func () {
92
+ Eventually (confirmDisconnectClusterDialog .AlertPopup , ASSERTION_1MINUTE_TIME_OUT ).Should (BeFound ())
93
+ Eventually (confirmDisconnectClusterDialog .ButtonRemove ).Should (BeFound ())
94
+ })
95
+
96
+ By ("And I click remove button and the alert is closed" , func () {
97
+ Expect (confirmDisconnectClusterDialog .ButtonRemove .Click ()).To (Succeed ())
98
+ Eventually (confirmDisconnectClusterDialog .AlertPopup ).ShouldNot (BeFound ())
99
+ })
100
+
101
+ By ("Then I should see the cluster removed from the table" , func () {
102
+ Eventually (pages .FindClusterInList (clustersPage , clusterName ).Name , ASSERTION_1MINUTE_TIME_OUT ).
103
+ ShouldNot (BeFound ())
104
+ })
105
+ }
106
+ }
107
+
57
108
func createClusterEntry (webDriver * agouti.Page , clusterName string ) (* pages.ClustersPage , * pages.ClusterConnectionPage ) {
58
109
59
110
//To check if page is loaded in its entirety
@@ -66,7 +117,7 @@ func createClusterEntry(webDriver *agouti.Page, clusterName string) (*pages.Clus
66
117
By ("And wait for the page to be fully loaded" , func () {
67
118
Eventually (clustersPage .SupportEmailLink ).Should (BeVisible ())
68
119
Eventually (clustersPage .ClusterCount ).Should (MatchText (`[0-9]+` ))
69
- time . Sleep ( UI_POLL_INTERVAL )
120
+ Eventually ( clustersPage . ClustersListSection ). Should ( BeFound () )
70
121
count , _ = clustersPage .ClusterCount .Text ()
71
122
tmpCount , _ := strconv .Atoi (count )
72
123
expectedCount = strconv .Itoa (tmpCount + 1 )
@@ -216,8 +267,6 @@ func DescribeMCCPClusters(mccpTestRunner MCCPTestRunner) {
216
267
217
268
AfterEach (func () {
218
269
TakeNextScreenshot ()
219
- //Tear down
220
- //Expect(webDriver.Destroy()).To(Succeed())
221
270
})
222
271
223
272
It ("Verify MCCP page structure first time with no cluster configured" , func () {
@@ -327,6 +376,8 @@ func DescribeMCCPClusters(mccpTestRunner MCCPTestRunner) {
327
376
By ("And I see Save & next button disabled" , func () {
328
377
Eventually (clusterConnectionPage .ButtonClusterSaveAndNext ).ShouldNot (BeEnabled ())
329
378
})
379
+
380
+ deleteClusterEntry (webDriver , []string {clusterNameMax })
330
381
})
331
382
332
383
It ("Verify that clusters table have correct column headers " , func () {
@@ -545,42 +596,14 @@ func DescribeMCCPClusters(mccpTestRunner MCCPTestRunner) {
545
596
It ("Verify disconnect cluster" , func () {
546
597
clusterName := RandString (32 )
547
598
fmt .Printf ("Generated a new cluster name! %s\n " , clusterName )
548
- clustersPage , clusterConnectionPage := createClusterEntry (webDriver , clusterName )
549
- confirmDisconnectClusterDialog := pages .GetConfirmDisconnectClusterDialog (webDriver )
599
+ _ , clusterConnectionPage := createClusterEntry (webDriver , clusterName )
550
600
551
601
By ("And the cluster connection popup is closed" , func () {
552
602
Expect (clusterConnectionPage .ButtonClose .Click ()).To (Succeed ())
553
603
Eventually (clusterConnectionPage .ClusterConnectionPopup ).ShouldNot (BeFound ())
554
604
})
555
605
556
- By ("And when I click edit cluster I should see disconnect cluster tab" , func () {
557
- Expect (pages .FindClusterInList (clustersPage , clusterName ).EditCluster .Click ()).To (Succeed ())
558
-
559
- Eventually (clusterConnectionPage .ClusterConnectionPopup ).Should (BeFound ())
560
- Eventually (clusterConnectionPage .DisconnectTab ).Should (BeFound ())
561
- })
562
-
563
- By ("And I open Disconnect tab and click Remove cluster from the MCCP button" , func () {
564
- Expect (clusterConnectionPage .DisconnectTab .Click ()).Should (Succeed ())
565
-
566
- Eventually (clusterConnectionPage .ButtonRemoveCluster ).Should (BeFound ())
567
- Expect (clusterConnectionPage .ButtonRemoveCluster .Click ()).To (Succeed ())
568
- })
569
-
570
- By ("Then I should see an alert popup with Remove button" , func () {
571
- Eventually (confirmDisconnectClusterDialog .AlertPopup , ASSERTION_1MINUTE_TIME_OUT ).Should (BeFound ())
572
- Eventually (confirmDisconnectClusterDialog .ButtonRemove ).Should (BeFound ())
573
- })
574
-
575
- By ("And I click remove button and the alert is closed" , func () {
576
- Expect (confirmDisconnectClusterDialog .ButtonRemove .Click ()).To (Succeed ())
577
- Eventually (confirmDisconnectClusterDialog .AlertPopup ).ShouldNot (BeFound ())
578
- })
579
-
580
- By ("Then I should see the cluster removed from the table" , func () {
581
- Eventually (pages .FindClusterInList (clustersPage , clusterName ).Name , ASSERTION_1MINUTE_TIME_OUT ).
582
- ShouldNot (BeFound ())
583
- })
606
+ deleteClusterEntry (webDriver , []string {clusterName })
584
607
})
585
608
586
609
It ("@wkp Verify team workspaces variations" , func () {
0 commit comments