mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
* Remove cypress and its dependencies from root dir * Install cypress to cypress-tests directory * Move cypress specs and utils * Remove older files * Fix package.json
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
import { path } from "Texts/common";
|
|
import { usersSelector } from "Selectors/manageUsers";
|
|
import { profileSelector } from "Selectors/profile";
|
|
import { commonSelectors } from "Selectors/common";
|
|
import moment from "moment";
|
|
|
|
export const navigateToProfile = () => {
|
|
cy.get(profileSelector.profileDropdown).invoke("show");
|
|
cy.contains("Profile").click();
|
|
cy.url().should("include", path.profilePath);
|
|
};
|
|
|
|
export const logout = () => {
|
|
cy.get(profileSelector.profileDropdown).invoke("show");
|
|
cy.contains("Logout").click();
|
|
cy.url().should("include", path.loginPath);
|
|
};
|
|
|
|
export const navigateToManageUsers = () => {
|
|
cy.get(usersSelector.dropdown).invoke("show");
|
|
cy.contains("Manage Users").click();
|
|
cy.url().should("include", path.manageUsers);
|
|
};
|
|
|
|
export const navigateToManageGroups = () => {
|
|
cy.get(commonSelectors.dropdown).invoke("show");
|
|
cy.contains("Manage Groups").click();
|
|
cy.url().should("include", path.manageGroups);
|
|
};
|
|
|
|
export const navigateToManageSSO = () => {
|
|
cy.get(commonSelectors.dropdown).invoke("show");
|
|
cy.contains("Manage SSO").click();
|
|
cy.url().should("include", path.manageSSO);
|
|
};
|
|
|
|
export const randomDateOrTime = (format = "DD/MM/YYYY") => {
|
|
let endDate = new Date();
|
|
let startDate = new Date(2018, 0, 1);
|
|
startDate = new Date(
|
|
startDate.getTime() +
|
|
Math.random() * (endDate.getTime() - startDate.getTime())
|
|
);
|
|
return moment(startDate).format(format);
|
|
};
|