From eab912bf0d6e4b71417a7f1d2149188b78b194ef Mon Sep 17 00:00:00 2001 From: Hamza Godil Date: Mon, 10 Jun 2024 20:22:40 +0500 Subject: [PATCH] CI/CD fails fix --- cypress/e2e/userIsAbleToUseTracker.cy.js | 6 ++++-- cypress/support/routeSupport.js | 2 ++ cypress/support/trackerAndGeofenceSupport.js | 3 --- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/userIsAbleToUseTracker.cy.js b/cypress/e2e/userIsAbleToUseTracker.cy.js index da7fa8b1..f50442bb 100644 --- a/cypress/e2e/userIsAbleToUseTracker.cy.js +++ b/cypress/e2e/userIsAbleToUseTracker.cy.js @@ -5,10 +5,10 @@ import { faker } from "@faker-js/faker"; import { Viewport } from "../support/constants"; -const geofenceName = faker.random.word(); - describe("Tracker", () => { context("Desktop view", () => { + const geofenceName = faker.random.word(); + beforeEach(() => { cy.visitDomain(`${Cypress.env("WEB_DOMAIN")}/demo`); cy.connectAwsAccount(Viewport.DESKTOP); @@ -20,6 +20,8 @@ describe("Tracker", () => { }); context("Responsive view", () => { + const geofenceName = faker.random.word(); + beforeEach(() => { cy.visitDomainInResponsiveView(`${Cypress.env("WEB_DOMAIN")}/demo`); cy.connectAwsAccount(Viewport.RESPONSIVE); diff --git a/cypress/support/routeSupport.js b/cypress/support/routeSupport.js index e40cd1f2..468be1e3 100644 --- a/cypress/support/routeSupport.js +++ b/cypress/support/routeSupport.js @@ -1,4 +1,5 @@ Cypress.Commands.add("searchRouteAndSelectCurrentLocation", () => { + cy.wait(20000); cy.get('[placeholder="From"]').click(); cy.get("div").should("contain", "Current location"); cy.get('[placeholder="From"]').type("Empire State Building", { delay: 200 }); @@ -16,6 +17,7 @@ Cypress.Commands.add("swapDepartureAndDestinationAddresses", () => { cy.wait(2000); cy.get('[placeholder="To"]').click().type("Gramercy Park", { delay: 200 }); cy.contains("Gramercy Park").click({ force: true }); + cy.wait(10000); cy.get('[class="mapboxgl-marker mapboxgl-marker-anchor-center"]').eq(0).should("be.visible"); cy.get('[class="mapboxgl-marker mapboxgl-marker-anchor-center"]').eq(1).should("be.visible"); cy.get('[class="amplify-flex swap-icon-container"]').click(); diff --git a/cypress/support/trackerAndGeofenceSupport.js b/cypress/support/trackerAndGeofenceSupport.js index 74701d9e..d08b51a1 100644 --- a/cypress/support/trackerAndGeofenceSupport.js +++ b/cypress/support/trackerAndGeofenceSupport.js @@ -32,9 +32,6 @@ Cypress.Commands.add("addTrackerAndGeofenceEnterExit", (isResponsive, geofenceNa cy.wait(5000); cy.contains("Save").click(); cy.get('[class="amplify-button amplify-field-group__control amplify-button--primary play-pause-button"]').click(); - if (isResponsive) { - cy.closeResponsiveMenu('[data-testid="bottomsheet"]'); - } cy.get( '[class="Toastify__toast Toastify__toast-theme--dark Toastify__toast--info Toastify__toast--close-on-click enter-geofence"]', { timeout: 50000 }