Skip to content

Commit

Permalink
Improve addRepository with regex
Browse files Browse the repository at this point in the history
Signed-off-by: Julien ADAMEK <[email protected]>
  • Loading branch information
juadk committed Nov 8, 2024
1 parent cf9c0c5 commit c0f4dae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cypressLib from '@rancher-ecp-qa/cypress-library';
/*
Copyright © 2022 - 2023 SUSE LLC
Copyright © 2022 - 2024 SUSE LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,7 +61,7 @@ export function addRepository(repositoryName, repositoryURL, repositoryType, rep
}
cy.clickButton('Create');
// Make sure the repo is active before leaving
cy.contains('Active '+ repositoryName)
cy.contains(new RegExp('Active.*'+repositoryName))
};

/**
Expand All @@ -77,12 +77,12 @@ export function deleteRepository(repositoryName) {
.should('be.visible');
cy.contains('Create')
.should('be.visible');
cy.contains('Active '+ repositoryName)
cy.contains(new RegExp('Active.*'+repositoryName))
.click();
cy.clickButton('Delete');
cypressLib.confirmDelete();
// Make sure the repo is removed before leaving
cy.contains('Active '+ repositoryName)
cy.contains(new RegExp('Active.*'+repositoryName))
.should('not.exist');
};

Expand Down

0 comments on commit c0f4dae

Please sign in to comment.