Skip to content

Commit

Permalink
refactor: change v1 urls
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer committed Jan 27, 2025
1 parent 1b0c633 commit cdffa6f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cypress-tests/cypress/support/commands/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function projectSubpageUrl(identifier: ProjectIdentifier, subpage: string) {
}

function searchForProject(props: ProjectIdentifier, shouldExist = true) {
cy.visit("/search");
cy.visit("/v1/search");
cy.get("input[placeholder='Search...']").should("exist").scrollIntoView();
cy.get("input[placeholder='Search...']")
.should("be.visible")
Expand All @@ -58,7 +58,8 @@ function searchForProject(props: ProjectIdentifier, shouldExist = true) {
.should("exist")
.scrollIntoView()
.should("be.visible");
} else {
}
else {
cy.get(props.name).should("not.exist");
}
}
Expand All @@ -71,9 +72,9 @@ interface NewProjectProps extends ProjectIdentifier {
function createProjectIfMissing(newProjectProps: NewProjectProps) {
const namespace = newProjectProps.namespace ?? Cypress.env("TEST_USERNAME");
const slug = encodeURIComponent(`${namespace}/${newProjectProps.name}`);
cy.request({failOnStatusCode: false, method: "GET", url: `/ui-server/api/projects/${slug}`}).then((response) => {
cy.request({ failOnStatusCode: false, method: "GET", url: `/ui-server/api/projects/${slug}` }).then((response) => {
if (response.status != 200) {
cy.visit("/projects/new");
cy.visit("/v1/projects/new");
cy.getDataCy("field-group-title")
.should("be.visible")
.clear()
Expand All @@ -97,7 +98,8 @@ function createProjectIfMissing(newProjectProps: NewProjectProps) {
cy.get("[data-cy=create-project-button]", { timeout: TIMEOUTS.vlong })
.should("be.enabled")
.click();
} else {
}
else {
cy.visit(`projects/${namespace}/${newProjectProps.name}`);
}
cy.url({ timeout: TIMEOUTS.vlong }).should(
Expand Down

0 comments on commit cdffa6f

Please sign in to comment.