Browse Source

test(misc): wait clean up

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3797/head
Raju Udava 2 years ago
parent
commit
4bddc45421
  1. 1
      packages/nc-gui/components/smartsheet-header/Menu.vue
  2. 14
      scripts/cypress/integration/common/6f_attachments.js
  3. 5
      scripts/cypress/integration/common/6g_base_share.js
  4. 12
      scripts/cypress/integration/common/7a_create_project_from_excel.js
  5. 10
      scripts/cypress/integration/common/8a_webhook.js
  6. 4
      scripts/cypress/integration/spec/roleValidation.spec.js
  7. 9
      scripts/cypress/support/commands.js
  8. 20
      scripts/cypress/support/page_objects/mainPage.js

1
packages/nc-gui/components/smartsheet-header/Menu.vue

@ -23,6 +23,7 @@ const { getMeta } = useMetas()
const deleteColumn = () =>
Modal.confirm({
title: h('div', ['Do you want to delete ', h('span', { class: 'font-weight-bold' }, [column?.value?.title]), ' column ?']),
wrapClassName: 'nc-modal-column-delete',
okText: t('general.delete'),
okType: 'danger',
cancelText: t('general.cancel'),

14
scripts/cypress/integration/common/6f_attachments.js

@ -27,15 +27,12 @@ export const genTest = (apiType, dbType) => {
// clean up newly added rows into Country table operations
// this auto verifies successfull addition of rows to table as well
mainPage.getPagination(5).click();
// kludge: flicker on load
cy.wait(3000);
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
// mainPage
// .getRow(10)
// .find(".mdi-checkbox-blank-outline")
// .click({ force: true });
// kludge: flicker on load
// cy.wait(3000);
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
@ -129,12 +126,7 @@ export const genTest = (apiType, dbType) => {
it(`Filter column which contain only attachments, download CSV`, () => {
// come back to main window
loginPage.loginAndOpenProject(apiType, dbType);
// cy.visit('/')
// cy.wait(5000)
// projectsPage.openConfiguredProject(apiType, dbType);
cy.openTableTab("Country", 25);
// cy.wait(1000);
mainPage.filterField("testAttach", "is not null", null);
mainPage.hideField("LastUpdate");

5
scripts/cypress/integration/common/6g_base_share.js

@ -21,12 +21,15 @@ export const genTest = (apiType, dbType) => {
const permissionValidation = (roleType) => {
it(`${roleType}: Visit base shared URL`, () => {
cy.log(linkText);
// http://localhost:8080/api/v1/db/meta/projects/p_4ufoizgrorwyey/tables?includeM2M=false
cy.intercept("/api/v1/db/meta/projects/**").as("waitForPageLoad");
// visit URL & wait for page load to complete
cy.visit(linkText, {
baseUrl: null,
});
cy.wait(5000);
cy.wait(["@waitForPageLoad"]);
// cy.wait(5000);
});
it(`${roleType}: Validate access permissions: advance menu`, () => {

12
scripts/cypress/integration/common/7a_create_project_from_excel.js

@ -87,12 +87,12 @@ export const genTest = (apiType, dbType) => {
sheetData = rows;
});
cy.visit("/");
// cy.visit("/");
projectsPage.createProject(
{ dbType: "none", apiType: "REST", name: "importSample" },
{}
);
cy.wait(4000);
// cy.wait(4000);
cy.saveLocalStorage();
});
@ -122,6 +122,11 @@ export const genTest = (apiType, dbType) => {
});
it("File Upload: Verify pre-load template page", () => {
// http://localhost:8080/api/v1/db/meta/audits/comments/count?ids[]=1&ids[]=2&fk_model_id=md_fq1vxy2181bzp0
cy.intercept("/api/v1/db/meta/audits/comments/count*").as(
"waitForPageLoad"
);
cy.getActiveModal()
.find(".ant-collapse-item")
.then((sheets) => {
@ -171,7 +176,8 @@ export const genTest = (apiType, dbType) => {
cy.getActiveModal().find(".ant-btn-primary").click();
// wait for page to get loaded (issue observed in CI-CD)
cy.wait(5000);
// cy.wait(5000);
cy.wait("@waitForPageLoad");
});
it("File Upload: Verify loaded data", () => {

10
scripts/cypress/integration/common/8a_webhook.js

@ -116,7 +116,7 @@ function configureWebhook(hook, test) {
.contains(new RegExp("^" + hook.condition.column + "$", "g"))
.should("exist")
.click();
cy.wait(1000);
// cy.wait(1000);
cy.get(".nc-filter-operation-select").should("exist").last().click();
cy.get(".ant-select-dropdown:visible")
@ -162,8 +162,11 @@ function clearServerData() {
function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click();
cy.wait(1000);
// cy.wait(1000);
cy.get(".nc-expand-col-Title")
.should("exist")
.find(".nc-cell > input")
.first()
.type(cellValue);
@ -185,6 +188,7 @@ function updateRow(index, cellValue) {
.click({ force: true });
cy.get(".nc-expand-col-Title")
.should("exist")
.find(".nc-cell > input")
.should("exist")
.first()
@ -207,7 +211,7 @@ function updateRow(index, cellValue) {
function verifyHookTrigger(count, lastValue) {
// allow message to be received
cy.wait(500);
cy.wait(100);
cy.request("http://localhost:9090/hook/count").then((msg) => {
cy.log(msg.body);

4
scripts/cypress/integration/spec/roleValidation.spec.js

@ -203,7 +203,7 @@ export function _editComment(roleType, mode) {
cy.openTableTab(columnName, 25);
cy.wait(1000);
// cy.wait(1000);
// click on comment icon & type comment
//
@ -214,7 +214,7 @@ export function _editComment(roleType, mode) {
// Everyone else: Comment added/read successfully
//
cy.wait(3000);
// cy.wait(3000);
if ("viewer" === roleType) {
cy.getActiveDrawer(".nc-drawer-expanded-form")

9
scripts/cypress/support/commands.js

@ -173,7 +173,7 @@ Cypress.Commands.add("closeTableTab", (tn) => {
.click();
// subsequent tab open commands will fail if tab is not closed completely
cy.wait(1000);
cy.wait(100);
});
Cypress.Commands.add("openOrCreateGqlProject", (_args) => {
@ -486,6 +486,13 @@ Cypress.Commands.add("signOut", () => {
cy.get('button:contains("SIGN IN")').should("exist");
});
// Navigation
//
Cypress.Commands.add("gotoProjectsPage", () => {
cy.get(".nc-noco-brand-icon").should("exist").click();
cy.get(`.nc-project-page-title:contains("My Projects")`).should("exist");
});
// Drag n Drop
// refer: https://stackoverflow.com/a/55409853
/*

20
scripts/cypress/support/page_objects/mainPage.js

@ -256,13 +256,21 @@ export class _mainPage {
.trigger("mouseover", { force: true })
.click({ force: true });
cy.wait(500);
// cy.wait(500);
// cy.get(".nc-column-delete").click();
cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-delete")
.click();
// cy.wait(500);
// cy.get(".nc-column-delete").should("not.be.visible");
// cy.get(".ant-btn-dangerous:visible").contains("Delete").click();
// cy.wait(500);
cy.get(".nc-column-delete").click();
cy.wait(500);
cy.get(".nc-column-delete").should("not.be.visible");
cy.get(".ant-btn-dangerous:visible").contains("Delete").click();
cy.wait(500);
cy.getActiveModal(".nc-modal-column-delete")
.find(".ant-btn-dangerous:visible")
.contains("Delete")
.click();
cy.get(`th:contains(${colName})`).should("not.exist");
};

Loading…
Cancel
Save