Browse Source

test: CY migration for pagination, airtable import

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3384/head
Raju Udava 2 years ago
parent
commit
d4f971f073
  1. 10
      scripts/cypress-v2/integration/common/7b_import_from_airtable.js
  2. 56
      scripts/cypress-v2/integration/common/9a_QuickTest.js
  3. 2
      scripts/cypress-v2/support/page_objects/navigation.js

10
scripts/cypress-v2/integration/common/7b_import_from_airtable.js

@ -13,7 +13,6 @@ export const genTest = (apiType, dbType) => {
describe(`Import from airtable`, () => {
before(() => {
cy.fileHook();
apiKey = Cypress.env("airtable").apiKey;
sharedBase = Cypress.env("airtable").sharedBase;
@ -21,14 +20,17 @@ export const genTest = (apiType, dbType) => {
projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {})
});
after(() => {});
after(() => {
cy.saveLocalStorage();
});
it("Import", () => {
cy.log(apiKey, sharedBase);
// trigger import
cy.get(`[data-menu-id="addORImport"]`).click();
cy.getActivePopUp().contains("Airtable").should('exist').click();
cy.get('.nc-add-new-table').should('exist').trigger('mouseover')
cy.get('.nc-import-menu').should('exist').click()
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Airtable').click()
cy.getActiveModal().find(".nc-input-api-key").should('exist').clear().type(apiKey)
cy.getActiveModal().find(".nc-input-shared-base").should('exist').clear().type(sharedBase)

56
scripts/cypress-v2/integration/common/9a_QuickTest.js

@ -81,7 +81,8 @@ export const genTest = (apiType, dbType, testMode) => {
}
before(() => {
cy.fileHook();
cy.restoreLocalStorage();
if( testMode === 'CY_QUICK') {
// cy.task("copyFile")
loginPage.signIn(roles.owner.credentials);
@ -102,7 +103,20 @@ export const genTest = (apiType, dbType, testMode) => {
cy.restoreLocalStorage();
})
after(() => {});
// afterEach(() => {
// cy.saveLocalStorage();
// })
after(() => {
// sign out
cy.visit(`/`);
cy.wait(5000);
cy.get('.nc-menu-accounts').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-item').eq(1).click();
cy.wait(5000);
cy.get('button:contains("SIGN")').should('exist')
});
it("Verify Schema", () => {
cy.openTableTab("Film", 3)
@ -221,7 +235,9 @@ export const genTest = (apiType, dbType, testMode) => {
it("Verify Views & Shared base", () => {
cy.openTableTab("Film", 3);
mainPage.toggleRightSidebar();
cy.get('.nc-form-view-item').eq(0)
cy.get('.nc-form-view-item:visible')
.should('exist')
.eq(0)
.click({ force: true })
// Header & description should exist
@ -345,29 +361,38 @@ export const genTest = (apiType, dbType, testMode) => {
mainPage.getPagination(">").click();
mainPage
.getPagination(2)
.should("have.class", "v-pagination__item--active");
.should("have.class", "ant-pagination-item-active");
// verify < pagination option
mainPage.getPagination("<").click();
mainPage
.getPagination(1)
.should("have.class", "v-pagination__item--active");
.should("have.class", "ant-pagination-item-active");
cy.closeTableTab("Actor");
});
it("Verify Fields, Filter & Sort", () => {
cy.openTableTab("Actor", 25);
mainPage.toggleRightSidebar();
cy.get(".nc-grid-view-item").eq(1).click()
cy.get(".nc-grid-header-cell").contains('Name').should("be.visible");
cy.get(".nc-grid-header-cell").contains('Notes').should("be.visible");
cy.get(".nc-grid-header").find(`th[data-title="Name"]`).should("be.visible");
cy.get(".nc-grid-header").find(`th[data-title="Notes"]`).should("be.visible");
cy.get(".nc-grid-header").find(`th[data-title="Attachments"]`).should("not.exist");
cy.get(".nc-grid-header").find(`th[data-title="Status"]`).should("be.visible");
cy.get(".nc-grid-header").find(`th[data-title="Film"]`).should("be.visible");
// cy.get(".nc-grid-header").contains('Notes').should("be.visible");
// fix me!
if(testMode !== 'AT_IMPORT') cy.get(".nc-grid-header-cell").contains('Attachments').should("not.be.visible");
cy.get(".nc-grid-header-cell").contains('Status').should("be.visible");
cy.get(".nc-grid-header-cell").contains('Film').should("be.visible");
// if(testMode !== 'AT_IMPORT') cy.get(".nc-grid-header-cell").contains('Attachments').should("not.be.visible");
// cy.get(".nc-grid-header-cell").contains('Status').should("be.visible");
// cy.get(".nc-grid-header-cell").contains('Film').should("be.visible");
cy.wait(2000);
cy.get(".nc-fields-menu-btn").click()
cy.get(".nc-fields-menu-btn").click();
cy.getActiveMenu().find(`[type="checkbox"]`).eq(0).should('be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(1).should('be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(2).should('not.be.checked')
@ -407,15 +432,18 @@ export const genTest = (apiType, dbType, testMode) => {
if( testMode === 'CY_QUICK') {
cy.openTableTab("Producer", 3)
mainPage.toggleRightSidebar();
cy.get('.nc-grid-view-item').should('have.length', 4)
cy.get('.nc-form-view-item').should('have.length', 4)
cy.get('.nc-gallery-view-item').should('have.length', 3)
// LinkToAnotherRecord hm relation
mainPage.getCell("FilmRead", 1).scrollIntoView();
cy.get(
':nth-child(1) > [data-col="FilmRead"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(1) > .v-chip__content > .name'
)
cy.get('[data-title="FilmRead"] > .h-full > .nc-virtual-cell > .w-full > .chips > .chip > .name')
// cy.get(
// ':nth-child(1) > [data-col="FilmRead"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(1) > .v-chip__content > .name'
// )
.contains('Movie-1')
.should("exist");

2
scripts/cypress-v2/support/page_objects/navigation.js

@ -137,6 +137,8 @@ export class _projectsPage {
cy.get(".nc-metadb-project-name").should("exist");
cy.contains("button", "Create").should("exist");
cy.wait(1000)
// feed project name
cy.get(".nc-metadb-project-name", { timeout: 20000 }).clear().type(
projectName

Loading…
Cancel
Save