Skip to content

Commit

Permalink
Merge pull request #191 from makeen-project/feature_ALS-1781_responsi…
Browse files Browse the repository at this point in the history
…ve_demo_cases

[Enhancements] Responsive automation
  • Loading branch information
wadhawh authored Jun 10, 2024
2 parents 8bcd4e7 + eab912b commit 4f8d706
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cypress/e2e/userIsAbleToUseTracker.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions cypress/support/routeSupport.js
Original file line number Diff line number Diff line change
@@ -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 });
Expand All @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions cypress/support/trackerAndGeofenceSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 4f8d706

Please sign in to comment.