Browse Source

refactor: file indentation alignment

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/1433/head
Raju Udava 3 years ago
parent
commit
b84918110c
  1. 4
      scripts/cypress/integration/common/3d_rollup_column.js
  2. 11
      scripts/cypress/integration/common/4b_table_view_share.js
  3. 75
      scripts/cypress/integration/common/4c_form_view_detailed.js
  4. 24
      scripts/cypress/integration/common/4d_table_view_grid_locked.js
  5. 22
      scripts/cypress/integration/common/6f_attachments.js
  6. 38
      scripts/cypress/integration/spec/roleValidation.spec.js

4
scripts/cypress/integration/common/3d_rollup_column.js

@ -36,9 +36,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".new-column-header").click();
// Column name
cy.get(".nc-column-name-input input")
.clear()
.type(`${columnName}`);
cy.get(".nc-column-name-input input").clear().type(`${columnName}`);
// Column data type: to be set to rollup in this context
// Type 'Rollup' ensures item outside view is also listed (note, rollup is at bottom of scroll list)

11
scripts/cypress/integration/common/4b_table_view_share.js

@ -11,7 +11,7 @@ const generateLinkWithPwd = () => {
// .click();
mainPage.shareView().click();
cy.snipActiveModal("Modal_ShareView")
cy.snipActiveModal("Modal_ShareView");
// enable checkbox & feed pwd, save
cy.getActiveModal()
@ -81,11 +81,16 @@ export const genTest = (apiType, dbType) => {
// })
// feed password
cy.getActiveModal().find('input[type="password"]').clear().type("1");
cy.getActiveModal()
.find('input[type="password"]')
.clear()
.type("1");
cy.getActiveModal().find('button:contains("Unlock")').click();
// if pwd is incorrect, active modal requesting to feed in password again will persist
cy.get("body").find(".v-dialog.v-dialog--active").should("not.exist");
cy.get("body")
.find(".v-dialog.v-dialog--active")
.should("not.exist");
});
it("Delete view", () => {

75
scripts/cypress/integration/common/4c_form_view_detailed.js

@ -50,21 +50,29 @@ export const genTest = (apiType, dbType) => {
it(`Validate ${viewType} view: Drag & drop for re-order items`, () => {
// default order: Country, LastUpdate, Country => City
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist");
cy.get(".nc-field-wrapper")
.eq(0)
.contains("Country")
.should("exist");
cy.get(".nc-field-wrapper")
.eq(1)
.contains("LastUpdate")
.should("exist");
// move Country field down (drag, drop)
cy.get("#data-table-form-Country").drag("#data-table-form-LastUpdate");
cy.get("#data-table-form-Country").drag(
"#data-table-form-LastUpdate"
);
// Verify if order is: LastUpdate, Country, Country => City
cy.get(".nc-field-wrapper")
.eq(0)
.contains("LastUpdate")
.should("exist");
cy.get(".nc-field-wrapper").eq(1).contains("Country").should("exist");
cy.get(".nc-field-wrapper")
.eq(1)
.contains("Country")
.should("exist");
});
it(`Validate ${viewType} view: Drag & drop for add/remove items`, () => {
@ -76,12 +84,20 @@ export const genTest = (apiType, dbType) => {
.should("exist");
// drag 'LastUpdate' & drop into menu bar drag-drop box
cy.get("#data-table-form-LastUpdate").drag(".nc-drag-n-drop-to-hide");
cy.get("#data-table-form-LastUpdate").drag(
".nc-drag-n-drop-to-hide"
);
// validate- fields count in menu bar to be increased by 1 &&
// first member in 'formView' is Country
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist");
cy.get(".col-md-4").find(".pointer.item").its("length").should("eq", 1);
cy.get(".nc-field-wrapper")
.eq(0)
.contains("Country")
.should("exist");
cy.get(".col-md-4")
.find(".pointer.item")
.its("length")
.should("eq", 1);
});
it(`Validate ${viewType} view: Inverted order field member addition from menu`, () => {
@ -96,7 +112,10 @@ export const genTest = (apiType, dbType) => {
// verify if order of appearance in form is right
// Country was never removed as its required field. Other two will appear in inverted order
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist");
cy.get(".nc-field-wrapper")
.eq(0)
.contains("Country")
.should("exist");
cy.get(".nc-field-wrapper")
.eq(1)
.contains("Country => City")
@ -109,13 +128,17 @@ export const genTest = (apiType, dbType) => {
it(`Validate ${viewType}: Form header & description validation`, () => {
// Header & description should exist
cy.get(".nc-form").find('[placeholder="Form Title"]').should("exist");
cy.get(".nc-form")
.find('[placeholder="Form Title"]')
.should("exist");
cy.get(".nc-form")
.find('[placeholder="Add form description"]')
.should("exist");
// Update header & add some description, verify
cy.get(".nc-form").find('[placeholder="Form Title"]').type("A B C D");
cy.get(".nc-form")
.find('[placeholder="Form Title"]')
.type("A B C D");
cy.get(".nc-form")
.find('[placeholder="Add form description"]')
.type("Some description about form comes here");
@ -156,7 +179,10 @@ export const genTest = (apiType, dbType) => {
.its("length")
.should("eq", 1);
// menu bar should contain 3 .pointer.item (LastUpdate, County->City)
cy.get(".col-md-4").find(".pointer.item").its("length").should("eq", 2);
cy.get(".col-md-4")
.find(".pointer.item")
.its("length")
.should("eq", 2);
// click: Add all
// cy.get('.col-md-4').find('.pointer.caption').contains('Remove all').should('not.exist')
@ -169,7 +195,9 @@ export const genTest = (apiType, dbType) => {
.contains("Remove all")
.should("exist");
// form should contain "field remove icons"
cy.get(".nc-form").find(".nc-field-remove-icon").should("exist");
cy.get(".nc-form")
.find(".nc-field-remove-icon")
.should("exist");
// Fix me: a dummy remove icon is left over on screen
cy.get(".nc-form")
.find(".nc-field-remove-icon")
@ -212,7 +240,9 @@ export const genTest = (apiType, dbType) => {
cy.getActiveModal().find("button").contains("OK").click();
// add message
cy.get(".nc-form > .mx-auto").find("textarea").type("Congratulations!");
cy.get(".nc-form > .mx-auto")
.find("textarea")
.type("Congratulations!");
// submit button & validate
cy.get(".nc-form").find("button").contains("Submit").click();
@ -236,13 +266,18 @@ export const genTest = (apiType, dbType) => {
cy.getActiveModal().find("button").contains("OK").click();
// enable "Submit another form" check box
cy.get(".nc-form > .mx-auto").find('[type="checkbox"]').eq(0).click();
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
.eq(0)
.click();
// submit button & validate
cy.get(".nc-form").find("button").contains("Submit").click();
cy.toastWait("Congratulations");
cy.get(".v-alert").contains("Congratulations").should("exist");
cy.get("button").contains("Submit Another Form").should("exist");
cy.get("button")
.contains("Submit Another Form")
.should("exist");
cy.get("button").contains("Submit Another Form").click();
cy.get(".nc-form").should("exist");
@ -273,7 +308,10 @@ export const genTest = (apiType, dbType) => {
.find('[type="checkbox"]')
.eq(0)
.click({ force: true });
cy.get(".nc-form > .mx-auto").find('[type="checkbox"]').eq(1).click();
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
.eq(1)
.click();
// submit button & validate
cy.get(".nc-form").find("button").contains("Submit").click();
@ -317,7 +355,12 @@ export const genTest = (apiType, dbType) => {
it(`Validate ${viewType}: Email me verification, with SMTP configuration`, () => {
// activate SMTP, dummy profile
mainPage.navigationDraw(mainPage.APPSTORE).click();
mainPage.configureSMTP("admin@ex.com", "smtp.ex.com", "8080", "TLS");
mainPage.configureSMTP(
"admin@ex.com",
"smtp.ex.com",
"8080",
"TLS"
);
// open form view & enable "email me" option
cy.openTableTab("Country", 25);

24
scripts/cypress/integration/common/4d_table_view_grid_locked.js

@ -24,9 +24,14 @@ export const genTest = (apiType, dbType) => {
// on menu, collaboration view appears first (at index 0)
// followed by Locked view (at index 1)
cy.get(".xc-toolbar").find(".nc-view-lock-menu:enabled").click();
cy.snipActiveMenu("Menu_Collaboration")
cy.getActiveMenu().find('[role="menuitem"]').eq(menuOption).click();
cy.get(".xc-toolbar")
.find(".nc-view-lock-menu:enabled")
.click();
cy.snipActiveMenu("Menu_Collaboration");
cy.getActiveMenu()
.find('[role="menuitem"]')
.eq(menuOption)
.click();
// expected toolbar for Lock view: Only lock-view menu, reload, toggle-nav-drawer to be enabled
//
@ -58,10 +63,15 @@ export const genTest = (apiType, dbType) => {
// dblClick on a cell & see if we can edit
mainPage.getCell("Country", 1).dblclick();
mainPage.getCell("Country", 1).find("input").should(`${vString}exist`);
mainPage
.getCell("Country", 1)
.find("input")
.should(`${vString}exist`);
// check if expand row option is available?
cy.get("td").find(".nc-row-expand-icon").should(`${vString}exist`);
cy.get("td")
.find(".nc-row-expand-icon")
.should(`${vString}exist`);
// alt validation: mainPage.getRow(1).find('.nc-row-expand-icon').should(`${vString}exist`)
// check if add/ expand options available for 'has many' column type
@ -78,7 +88,9 @@ export const genTest = (apiType, dbType) => {
// update row option (right click) - should not be available for Lock view
mainPage.getCell("Country => City", 1).rightclick();
cy.get(".menuable__content__active").should(`${vString}be.visible`);
cy.get(".menuable__content__active").should(
`${vString}be.visible`
);
});
};

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

@ -40,7 +40,10 @@ export const genTest = (apiType, dbType) => {
.click()
.find('input[type="file"]')
.attachFile(filepath);
mainPage.getCell("testAttach", i).find(".mdi-file").should("exist");
mainPage
.getCell("testAttach", i)
.find(".mdi-file")
.should("exist");
}
});
@ -51,7 +54,9 @@ export const genTest = (apiType, dbType) => {
cy.toastWait("View created successfully");
cy.get(`.nc-view-item.nc-form-view-item`).contains("Country1").click();
cy.get(`.nc-view-item.nc-form-view-item`)
.contains("Country1")
.click();
// cy.get(".v-navigation-drawer__content > .container")
// .should("exist")
@ -73,7 +78,9 @@ export const genTest = (apiType, dbType) => {
// wait for share view page to load!
cy.get("#data-table-form-Country").should("exist").type("_abc");
cy.get("#data-table-form-Country")
.should("exist")
.type("_abc");
cy.get("#data-table-form-LastUpdate").click();
cy.getActiveModal().find("button").contains("19").click();
cy.getActiveModal().find("button").contains("OK").click();
@ -84,7 +91,10 @@ export const genTest = (apiType, dbType) => {
.attachFile(`sampleFiles/1.json`);
// submit button & validate
cy.get(".nc-form").find("button").contains("Submit").click();
cy.get(".nc-form")
.find("button")
.contains("Submit")
.click();
cy.toastWait("Saved successfully");
});
});
@ -106,7 +116,9 @@ export const genTest = (apiType, dbType) => {
expect(retrievedRecords[0]).to.be.equal(storedRecords[0]);
for (let i = 1; i < storedRecords.length; i++) {
const columns = retrievedRecords[i].split(",");
expect(columns[2]).to.contain(".json(http://localhost:8080/dl/");
expect(columns[2]).to.contain(
".json(http://localhost:8080/dl/"
);
}
cy.log(retrievedRecords[109]);

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

@ -27,11 +27,15 @@ export function _advSettings(roleType, previewMode) {
mainPage.navigationDraw(mainPage.ROLE_VIEW_RESET).should("exist");
} else {
// normal mode, role toggle menubar is visible only for owner/ creator
mainPage.navigationDraw(mainPage.ROLE_VIEW_EDITOR).should(validationString);
mainPage
.navigationDraw(mainPage.ROLE_VIEW_EDITOR)
.should(validationString);
mainPage
.navigationDraw(mainPage.ROLE_VIEW_COMMENTER)
.should(validationString);
mainPage.navigationDraw(mainPage.ROLE_VIEW_VIEWER).should(validationString);
mainPage
.navigationDraw(mainPage.ROLE_VIEW_VIEWER)
.should(validationString);
}
}
@ -62,7 +66,9 @@ export function _editSchema(roleType, previewMode) {
// update column (edit/ delete menu)
//
cy.get(`th:contains(${columnName}) .mdi-menu-down`).should(validationString);
cy.get(`th:contains(${columnName}) .mdi-menu-down`).should(
validationString
);
}
export function _editData(roleType, previewMode) {
@ -94,14 +100,22 @@ export function _editData(roleType, previewMode) {
// update cell contents option using row expander should be enabled
//
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
cy.get(".v-input.row-checkbox").eq(4).next().next().click({ force: true });
cy.get(".v-input.row-checkbox")
.eq(4)
.next()
.next()
.click({ force: true });
cy.getActiveModal().find("button").contains("Save row").should("exist");
cy.get("body").type("{esc}");
} else {
// update cell contents option using row expander should be disabled
//
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
cy.get(".v-input.row-checkbox").eq(4).next().next().click({ force: true });
cy.get(".v-input.row-checkbox")
.eq(4)
.next()
.next()
.click({ force: true });
cy.getActiveModal()
.find("button:disabled")
.contains("Save row")
@ -159,7 +173,11 @@ export function _editComment(roleType, previewMode) {
.should("exist");
}
cy.getActiveModal().find("button").contains("Cancel").should("exist").click();
cy.getActiveModal()
.find("button")
.contains("Cancel")
.should("exist")
.click();
cy.get("body").type("{esc}");
}
@ -208,11 +226,13 @@ export function _viewMenu(roleType, previewMode) {
// mainPage.automations().should(validationString);
// share view permissions are role specific
cy.get('.nc-btn-share-view').should(validationString);
cy.get(".nc-btn-share-view").should(validationString);
// actions menu (more), only download csv should be visible for non-previlaged users
cy.get('.nc-actions-menu-btn').click();
cy.getActiveMenu().find('[role="menuitem"]').should("have.length", actionsMenuItemsCnt);
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu()
.find('[role="menuitem"]')
.should("have.length", actionsMenuItemsCnt);
}
export function _topRightMenu(roleType, previewMode) {

Loading…
Cancel
Save