-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5713 from coronasafe/develop
Production Release; June Week 3
- Loading branch information
Showing
76 changed files
with
1,418 additions
and
2,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import { cy, describe, before, beforeEach, it } from "local-cypress"; | ||
import { v4 as uuidv4 } from "uuid"; | ||
|
||
describe("Assets List", () => { | ||
const phone_number = "9999999999"; | ||
const serial_no = parseInt((Math.random() * 10 ** 10).toString()); | ||
|
||
describe("Asset", () => { | ||
before(() => { | ||
cy.loginByApi("devdistrictadmin", "Coronasafe@123"); | ||
cy.saveLocalStorage(); | ||
|
@@ -13,6 +17,64 @@ describe("Assets List", () => { | |
cy.awaitUrl("/assets"); | ||
}); | ||
|
||
it("Create an Asset", () => { | ||
cy.get("button").should("contain", "Create Asset"); | ||
cy.get("[data-testid=create-asset-buttom] button").click(); | ||
cy.get("input[name='facilities']") | ||
.type("Dummy Facility 1") | ||
.then(() => { | ||
cy.get("[role='option']").contains("Dummy Facility 1").click(); | ||
}); | ||
cy.get("button").should("contain", "Select"); | ||
cy.get("button").get("#submit").click(); | ||
cy.get("[data-testid=asset-name-input] input").type("New Test Asset"); | ||
cy.get("[data-testid=asset-location-input] input") | ||
.type("Camera Locat") | ||
.then(() => { | ||
cy.get("[role='option']").contains("Camera Locations").click(); | ||
}); | ||
cy.get("[data-testid=asset-type-input] button") | ||
.click() | ||
.then(() => { | ||
cy.get("[role='option']").contains("Internal").click(); | ||
}); | ||
cy.get("[data-testid=asset-class-input] button") | ||
.click() | ||
.then(() => { | ||
cy.get("[role='option']").contains("ONVIF Camera").click(); | ||
}); | ||
cy.get("[data-testid=asset-description-input] textarea").type( | ||
"Test Description" | ||
); | ||
cy.get("[data-testid=asset-working-status-input] li") | ||
.contains("Working") | ||
.click(); | ||
const qr_id = uuidv4(); | ||
cy.get("[data-testid=asset-qr-id-input] input").type(qr_id); | ||
cy.get("[data-testid=asset-manufacturer-input] input").type( | ||
"Manufacturer's Name" | ||
); | ||
cy.get("[data-testid=asset-warranty-input] input").type("2025-12-25"); | ||
cy.get("[data-testid=asset-support-name-input] input").type( | ||
"Customer Support's Name" | ||
); | ||
cy.get("#customer-support-phone-div").type(phone_number); | ||
cy.get("[data-testid=asset-support-email-input] input").type( | ||
"[email protected]" | ||
); | ||
cy.get("[data-testid=asset-vendor-name-input] input").type("Vendor's Name"); | ||
cy.get("[data-testid=asset-serial-number-input] input").type(serial_no); | ||
cy.get("[data-testid=asset-last-serviced-on-input] input").type( | ||
"2021-12-25" | ||
); | ||
cy.get("[data-testid=asset-notes-input] textarea").type( | ||
"Test note for asset creation!" | ||
); | ||
cy.wait(500); | ||
cy.get("#submit").contains("Create Asset").click(); | ||
cy.verifyNotification("Asset created successfully"); | ||
}); | ||
|
||
it("Search Asset Name", () => { | ||
const initialUrl = cy.url(); | ||
cy.get("[name='search']").type("dummy camera 30"); | ||
|
@@ -30,13 +92,9 @@ describe("Assets List", () => { | |
|
||
it("Next/Previous Page", () => { | ||
// only works for desktop mode | ||
cy.get("button") | ||
.should("contain", "Next") | ||
.contains("Next") | ||
.click({ force: true }); | ||
cy.get("button") | ||
.should("contain", "Previous") | ||
.contains("Previous") | ||
.click({ force: true }); | ||
cy.get("button#next-pages").click(); | ||
cy.url().should("include", "page=2"); | ||
cy.get("button#prev-pages").click(); | ||
cy.url().should("include", "page=1"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
a5a507b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
care-storybook – ./
care-storybook-git-master-coronasafe.vercel.app
care-storybook-coronasafe.vercel.app