PromucFlow_constructor/app/client/cypress/support/themeCommands.js
NandanAnantharamu 4f3176daf9
test: updated themeCommands (#33632)
RCA: There are many unused commands within themeCommands.js file

Solution:
Checked the themeCommands in both CE and EE repository and we are
removing those commands which are not used in any tests as part of
cleanup activity

/ok-to-test tags="@tag.All"<!-- This is an auto-generated comment:
Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9184741418>
> Commit: 84481f0e7ad9cdf5c70019c9f1c9d058fb89306c
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9184741418&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-05-27 23:10:20 +05:30

41 lines
1.3 KiB
JavaScript

/* eslint-disable cypress/no-unnecessary-waiting */
/* eslint-disable cypress/no-assigning-return-values */
/* Contains all methods related to Workspace features*/
require("cy-verify-downloads").addCustomCommand();
require("cypress-file-upload");
const themelocator = require("../locators/ThemeLocators.json");
import { ObjectsRegistry } from "../support/Objects/Registry";
const theme = ObjectsRegistry.ThemeSettings;
Cypress.Commands.add("borderMouseover", (index, text) => {
cy.get(themelocator.border).eq(index).trigger("mouseover");
cy.wait(1000);
cy.get(themelocator.popover).contains(text);
});
Cypress.Commands.add("colorMouseover", (index, text) => {
let colorType =
index == 0
? theme.locators._colorRingPrimary
: theme.locators._colorRingBackground;
cy.get(colorType).trigger("mouseover");
cy.wait(2000);
cy.get(themelocator.popover).contains(text);
cy.get(colorType).click();
});
Cypress.Commands.add("validateColor", (type, text) => {
// cy.get(theme.locators._colorInput(type)).click({ force: true });
// cy.wait(1000);
cy.xpath(theme.locators._colorInput(type)).should("have.value", text);
cy.wait(1000);
});
Cypress.Commands.add("chooseColor", (index, color) => {
cy.get(themelocator.colorPicker).eq(index).click({ force: true });
cy.get(color).last().click();
cy.wait(2000);
});