@@ -591,6 +591,89 @@ describe("Test Application deployment based on 'clusterSelector'", { tags: '@p1_
591
591
)
592
592
} )
593
593
)
594
+
595
+ qase ( 22 ,
596
+ it ( "Fleet-22: Test install app to new set of clusters from old set of clusters" , { tags : '@fleet-22' } , ( ) => {
597
+ const repoName = 'default-multiple-apps-cluster-selector'
598
+ const new_key = 'key_third_cluster'
599
+ const new_value = 'value_third_cluster'
600
+
601
+ gitRepoFile = 'assets/git-repo-multiple-app-cluster-selector.yaml'
602
+
603
+ cy . accesMenuSelection ( 'Continuous Delivery' , 'Clusters' ) ;
604
+ cy . contains ( '.title' , 'Clusters' ) . should ( 'be.visible' ) ;
605
+
606
+ // Assign label to the clusters
607
+ dsFirstTwoClusterList . forEach (
608
+ ( dsCluster ) => {
609
+ cy . assignClusterLabel ( dsCluster , key , value ) ;
610
+ }
611
+ )
612
+
613
+ // Create a GitRepo targeting cluster selector created from YAML.
614
+ cy . clickNavMenu ( [ 'Git Repos' ] ) ;
615
+ cy . wait ( 500 ) ;
616
+ cy . clickButton ( 'Add Repository' ) ;
617
+ cy . contains ( 'Git Repo:' ) . should ( 'be.visible' ) ;
618
+ cy . clickButton ( 'Edit as YAML' ) ;
619
+ cy . addYamlFile ( gitRepoFile ) ;
620
+ cy . clickButton ( 'Create' ) ;
621
+ cy . checkGitRepoStatus ( 'default-multiple-apps-cluster-selector' , '2 / 2' ) ;
622
+
623
+ // Check first application status on both clusters.
624
+ dsFirstTwoClusterList . forEach ( ( dsCluster ) => {
625
+ cy . checkApplicationStatus ( appName , dsCluster , 'All Namespaces' ) ;
626
+ } )
627
+
628
+ // Add label to the third cluster
629
+ cy . accesMenuSelection ( 'Continuous Delivery' , 'Clusters' ) ;
630
+ cy . contains ( '.title' , 'Clusters' ) . should ( 'be.visible' ) ;
631
+ cy . assignClusterLabel ( dsThirdClusterName , new_key , new_value ) ;
632
+
633
+ // Update GitRepo with newly created clusterGroup.
634
+ cy . addFleetGitRepo ( { repoName, deployToTarget : "Advanced" , fleetNamespace : 'fleet-default' , editConfig : true } ) ;
635
+ cy . clickButton ( 'Save' ) ;
636
+ cy . checkGitRepoStatus ( repoName , '2 / 2' ) ;
637
+
638
+ // Check application is present on third cluster i.e. imported-2
639
+ cy . checkApplicationStatus ( appName , dsThirdClusterName , 'All Namespaces' ) ;
640
+
641
+ // Applying Force Update in 2.9 and 2.10 versions only as it doesn't have cluster sync logic
642
+ if ( / \/ 2 \. 1 0 / . test ( Cypress . env ( 'rancher_version' ) ) || / \/ 2 \. 9 / . test ( Cypress . env ( 'rancher_version' ) ) ) {
643
+ cy . accesMenuSelection ( 'Continuous Delivery' , 'Clusters' ) ;
644
+ cy . contains ( '.title' , 'Clusters' ) . should ( 'be.visible' ) ;
645
+ dsFirstTwoClusterList . forEach (
646
+ ( dsCluster ) => {
647
+ cy . filterInSearchBox ( dsCluster ) ;
648
+ cy . open3dotsMenu ( dsCluster , 'Force Update' ) ;
649
+ cy . wait ( 2000 ) ; // It take some time to Update.
650
+ cy . verifyTableRow ( 0 , 'Active' ) ;
651
+ }
652
+ )
653
+ }
654
+
655
+ // Check application status on first 2 clusters i.e. imported-0 and imported-1
656
+ // Application should be removed from first 2 clusters i.e. imported-0 and imported-1
657
+ dsFirstTwoClusterList . forEach (
658
+ ( dsCluster ) => {
659
+ cy . checkApplicationStatus ( appName , dsCluster , 'All Namespaces' , false ) ;
660
+ }
661
+ )
662
+
663
+ // Remove labels from the clusters i.e. imported-0 and imported-1
664
+ dsFirstTwoClusterList . forEach (
665
+ ( dsCluster ) => {
666
+ // Adding wait to load page correctly to avoid interference with hamburger-menu.
667
+ cy . wait ( 500 ) ;
668
+ cy . removeClusterLabels ( dsCluster , key , value ) ;
669
+ }
670
+ )
671
+
672
+ // Remove labels from third cluster i.e. imported-2
673
+ cy . removeClusterLabels ( dsThirdClusterName , new_key , new_value ) ;
674
+ } )
675
+ )
676
+
594
677
} ) ;
595
678
596
679
describe ( "Test Application deployment based on 'clusterGroupSelector'" , { tags : '@p1_2' } , ( ) => {
0 commit comments