|
|
|
@ -39,30 +39,31 @@ let cn = [ "Name", "Notes", "Status", "Tags", "Done", "Date", "Phone",
|
|
|
|
|
"Actor", "Status (from Actor)", "RollUp", "Computation", "Producer" ] |
|
|
|
|
|
|
|
|
|
function openWebhook(index) { |
|
|
|
|
cy.get(".nc-btn-webhook").should("exist").click(); |
|
|
|
|
cy.get(".nc-hook").eq(index).click({ force: true }); |
|
|
|
|
cy.get('.nc-actions-menu-btn').should('exist').click(); |
|
|
|
|
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click() |
|
|
|
|
|
|
|
|
|
cy.get(".nc-hook").eq(index).click(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// to be invoked after open
|
|
|
|
|
function verifyWebhook(config) { |
|
|
|
|
cy.get(".nc-text-field-hook-title") |
|
|
|
|
.find('input').then(($element) => { |
|
|
|
|
cy.get(".nc-text-field-hook-title").then(($element) => { |
|
|
|
|
expect($element[0].value).to.have.string(config.title) |
|
|
|
|
}) |
|
|
|
|
cy.get(".nc-text-field-hook-event") |
|
|
|
|
.find('.v-select__selection') |
|
|
|
|
.find('.ant-select-selection-item') |
|
|
|
|
.contains(config.event) |
|
|
|
|
.should('exist') |
|
|
|
|
cy.get(".nc-text-field-hook-notification-type") |
|
|
|
|
.find('.v-select__selection') |
|
|
|
|
cy.get(".nc-select-hook-notification-type") |
|
|
|
|
.find('.ant-select-selection-item') |
|
|
|
|
.contains(config.notification) |
|
|
|
|
.should('exist') |
|
|
|
|
cy.get('.nc-select-hook-url-method') |
|
|
|
|
.find('.v-select__selection') |
|
|
|
|
.find('.ant-select-selection-item') |
|
|
|
|
.contains(config.type) |
|
|
|
|
.should('exist') |
|
|
|
|
cy.get(".nc-text-field-hook-url-path") |
|
|
|
|
.find('input').then(($element) => { |
|
|
|
|
.then(($element) => { |
|
|
|
|
expect($element[0].value).to.have.string(config.url) |
|
|
|
|
}) |
|
|
|
|
cy.get(".nc-icon-hook-navigate-left").click({force:true}) |
|
|
|
@ -80,26 +81,56 @@ export const genTest = (apiType, dbType, testMode) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
before(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
|
|
if( testMode === 'CY_QUICK') { |
|
|
|
|
// cy.task("copyFile")
|
|
|
|
|
loginPage.signIn(roles.owner.credentials); |
|
|
|
|
projectsPage.openProject("sample"); |
|
|
|
|
|
|
|
|
|
// kludge: wait for page load to finish
|
|
|
|
|
cy.wait(2000); |
|
|
|
|
// close team & auth tab
|
|
|
|
|
cy.get('button.ant-tabs-tab-remove').should('exist').click(); |
|
|
|
|
cy.wait(1000); |
|
|
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
after(() => {}); |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// afterEach(() => {
|
|
|
|
|
// cy.saveLocalStorage();
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
|
|
// 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) |
|
|
|
|
|
|
|
|
|
// verify if all tables exist
|
|
|
|
|
for(let i=0; i<tn.length; i++) |
|
|
|
|
cy.get(".nc-project-tree").contains(tn[i]).should('exist') |
|
|
|
|
for(let i=0; i<tn.length; i++) { |
|
|
|
|
cy.get(`.nc-project-tree-tbl-${tn[i]}`).should('exist') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// for Film table, verify columns
|
|
|
|
|
for(let i=0; i<columnCount; i++) |
|
|
|
|
cy.get(".nc-grid-header-row").find(`[data-col="${cn[i]}"]`).should('exist') |
|
|
|
|
for(let i=0; i<columnCount; i++) { |
|
|
|
|
cy.get(`th[data-title="${cn[i]}"]`).should("exist"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -114,20 +145,18 @@ export const genTest = (apiType, dbType, testMode) => {
|
|
|
|
|
// checkbox
|
|
|
|
|
mainPage |
|
|
|
|
.getCell("Done", cellIdx) |
|
|
|
|
.find(".mdi-check-circle-outline") |
|
|
|
|
.should(records2.Done ? "exist" : "not.exist"); |
|
|
|
|
.find(".nc-cell-hover-show") |
|
|
|
|
.should(records2.Done ? "not.exist" : "exist"); |
|
|
|
|
|
|
|
|
|
// date
|
|
|
|
|
|
|
|
|
|
// duration
|
|
|
|
|
mainPage.getCell("Duration", cellIdx).find('input').then(($e) => { |
|
|
|
|
expect($e[0].value).to.equal(records2.Duration) |
|
|
|
|
}) |
|
|
|
|
mainPage.getCell("Duration", cellIdx).contains(records2.Duration).should("exist"); |
|
|
|
|
|
|
|
|
|
// rating
|
|
|
|
|
mainPage |
|
|
|
|
.getCell("Rating", cellIdx) |
|
|
|
|
.find("button.mdi-star") |
|
|
|
|
.find(".ant-rate-star-full") |
|
|
|
|
.should("have.length", records2.Rating); |
|
|
|
|
|
|
|
|
|
// verifying only one instance as its different for PG & SQLite
|
|
|
|
@ -135,58 +164,34 @@ export const genTest = (apiType, dbType, testMode) => {
|
|
|
|
|
// for SQLite: its Actor1, Actor2
|
|
|
|
|
// LinkToAnotherRecord
|
|
|
|
|
mainPage.getCell("Actor", cellIdx).scrollIntoView(); |
|
|
|
|
cy.get( |
|
|
|
|
`:nth-child(${cellIdx}) > [data-col="Actor"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(1) > .v-chip__content > .name` |
|
|
|
|
) |
|
|
|
|
cy.get(`:nth-child(${cellIdx}) > [data-title="Actor"]`) |
|
|
|
|
.find('.chip') |
|
|
|
|
.eq(0) |
|
|
|
|
.contains(records2.Actor[0]) |
|
|
|
|
.should("exist"); |
|
|
|
|
// cy.get(
|
|
|
|
|
// `:nth-child(${cellIdx}) > [data-col="Actor"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(2) > .v-chip__content > .name`
|
|
|
|
|
// )
|
|
|
|
|
// .contains(records2.Actor[1])
|
|
|
|
|
// .should("exist");
|
|
|
|
|
|
|
|
|
|
// lookup
|
|
|
|
|
mainPage.getCell("Status (from Actor)", cellIdx).scrollIntoView(); |
|
|
|
|
cy.get( |
|
|
|
|
`:nth-child(${cellIdx}) > [data-col="Status (from Actor)"] > .nc-virtual-cell > .v-lazy > .d-flex > :nth-child(1) > .v-chip__content > div > .set-item` |
|
|
|
|
) |
|
|
|
|
cy.get(`:nth-child(${cellIdx}) > [data-title="Status (from Actor)"]`) |
|
|
|
|
.find('.nc-cell') |
|
|
|
|
.eq(0) |
|
|
|
|
.contains(records2["Status (from Actor)"][0]) |
|
|
|
|
.should("exist"); |
|
|
|
|
// cy.get(
|
|
|
|
|
// `:nth-child(${cellIdx}) > [data-col="Status (from Actor)"] > .nc-virtual-cell > .v-lazy > .d-flex > :nth-child(2) > .v-chip__content > div > .set-item`
|
|
|
|
|
// )
|
|
|
|
|
// .contains(records2["Status (from Actor)"][1])
|
|
|
|
|
// .should("exist");
|
|
|
|
|
|
|
|
|
|
// rollup
|
|
|
|
|
if( testMode === 'CY_QUICK') { |
|
|
|
|
|
|
|
|
|
mainPage.getCell("RollUp", cellIdx).scrollIntoView(); |
|
|
|
|
cy.get(`:nth-child(${cellIdx}) > [data-col="RollUp"] > .nc-virtual-cell`) |
|
|
|
|
.contains(records2.RollUp) |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage.getCell("RollUp", cellIdx).contains(records2.RollUp).should("exist"); |
|
|
|
|
|
|
|
|
|
// formula
|
|
|
|
|
mainPage.getCell("Computation", cellIdx).scrollIntoView(); |
|
|
|
|
cy.get( |
|
|
|
|
`:nth-child(${cellIdx}) > [data-col="Computation"] > .nc-virtual-cell` |
|
|
|
|
) |
|
|
|
|
.contains(records2.Computation) |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage.getCell("Computation", cellIdx).contains(records2.Computation).should("exist"); |
|
|
|
|
|
|
|
|
|
// ltar hm relation
|
|
|
|
|
mainPage.getCell("Producer", cellIdx).scrollIntoView(); |
|
|
|
|
cy.get( |
|
|
|
|
`:nth-child(${cellIdx}) > [data-col="Producer"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(1) > .v-chip__content > .name` |
|
|
|
|
) |
|
|
|
|
.contains(records2.Producer[0]) |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get( |
|
|
|
|
`:nth-child(${cellIdx}) > [data-col="Producer"] > .nc-virtual-cell > .v-lazy > .d-100 > .chips > :nth-child(2) > .v-chip__content > .name` |
|
|
|
|
) |
|
|
|
|
.contains(records2.Producer[1]) |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage.getCell("Producer", cellIdx).find('.chip').eq(0).contains(records2.Producer[0]).should('exist') |
|
|
|
|
mainPage.getCell("Producer", cellIdx).find('.chip').eq(1).contains(records2.Producer[1]).should('exist') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.closeTableTab("Film"); |
|
|
|
@ -194,55 +199,80 @@ export const genTest = (apiType, dbType, testMode) => {
|
|
|
|
|
|
|
|
|
|
it("Verify Views & Shared base", () => { |
|
|
|
|
cy.openTableTab("Film", 3); |
|
|
|
|
cy.get('.nc-form-view-item').eq(0) |
|
|
|
|
.click({ force: true }) |
|
|
|
|
mainPage.toggleRightSidebar(); |
|
|
|
|
cy.get('.nc-form-view-item:visible') |
|
|
|
|
.should('exist') |
|
|
|
|
.eq(0) |
|
|
|
|
.click({ force: true }) |
|
|
|
|
|
|
|
|
|
// Header & description should exist
|
|
|
|
|
// cy.get(".nc-form")
|
|
|
|
|
// .find('[placeholder="Form Title"]')
|
|
|
|
|
// .contains("FormTitle")
|
|
|
|
|
// .should("exist");
|
|
|
|
|
// cy.get(".nc-form")
|
|
|
|
|
// .find('[placeholder="Add form description"]')
|
|
|
|
|
// .contains("FormDescription")
|
|
|
|
|
// .should("exist");
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-form").should("exist"); |
|
|
|
|
|
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Form Title"]') |
|
|
|
|
.contains("FormTitle") |
|
|
|
|
.should("exist"); |
|
|
|
|
.find('[placeholder="Form Title"]') |
|
|
|
|
.should("exist").then(($el) => { |
|
|
|
|
cy.log($el) |
|
|
|
|
expect($el.val()).to.equal("FormTitle"); |
|
|
|
|
}) |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Add form description"]') |
|
|
|
|
.contains("FormDescription") |
|
|
|
|
.should("exist"); |
|
|
|
|
.find('[placeholder="Add form description"]') |
|
|
|
|
.should("exist").then(($el) => { |
|
|
|
|
cy.log($el) |
|
|
|
|
expect($el.val()).to.equal("FormDescription"); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// modified column name & help text
|
|
|
|
|
cy.get(".nc-field-wrapper").eq(0) |
|
|
|
|
.find('.nc-field-labels') |
|
|
|
|
cy.get(".nc-editable").eq(0) |
|
|
|
|
.find('.name') |
|
|
|
|
.contains("DisplayName") |
|
|
|
|
.should('exist') |
|
|
|
|
cy.get(".nc-field-wrapper").eq(0) |
|
|
|
|
.find('.nc-hint') |
|
|
|
|
cy.get(".nc-editable").eq(0) |
|
|
|
|
.find('.text-gray-500') |
|
|
|
|
.contains('HelpText') |
|
|
|
|
.should('exist') |
|
|
|
|
|
|
|
|
|
cy.get(".nc-field-wrapper").eq(1) |
|
|
|
|
.find('.nc-field-labels') |
|
|
|
|
cy.get(".nc-editable").eq(1) |
|
|
|
|
.find('.name') |
|
|
|
|
.contains("Email") |
|
|
|
|
.should('exist') |
|
|
|
|
|
|
|
|
|
// add message
|
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find("textarea").then(($element) => { |
|
|
|
|
expect($element[0].value).to.have.string("Thank you for submitting the form!") |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// submit another form button
|
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(0) |
|
|
|
|
.should('be.checked') |
|
|
|
|
// "New form after 5 seconds" button
|
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(1) |
|
|
|
|
.should('be.checked') |
|
|
|
|
// email me
|
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(2) |
|
|
|
|
.should('not.be.checked') |
|
|
|
|
cy.get("textarea.nc-form-after-submit-msg").then(($element) => { |
|
|
|
|
expect($element[0].value).to.have.string("Thank you for submitting the form!") |
|
|
|
|
}) |
|
|
|
|
// cy.get(".nc-form > .mx-auto")
|
|
|
|
|
// .find("textarea").then(($element) => {
|
|
|
|
|
// expect($element[0].value).to.have.string("Thank you for submitting the form!")
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
cy.get("button.nc-form-checkbox-submit-another-form.ant-switch-checked").should('exist') |
|
|
|
|
cy.get("button.nc-form-checkbox-show-blank-form.ant-switch-checked").should('exist') |
|
|
|
|
cy.get("button.nc-form-checkbox-send-email.ant-switch-checked").should('not.exist') |
|
|
|
|
|
|
|
|
|
// // submit another form button
|
|
|
|
|
// cy.get(".nc-form > .mx-auto")
|
|
|
|
|
// .find('[type="checkbox"]')
|
|
|
|
|
// .eq(0)
|
|
|
|
|
// .should('be.checked')
|
|
|
|
|
// // "New form after 5 seconds" button
|
|
|
|
|
// cy.get(".nc-form > .mx-auto")
|
|
|
|
|
// .find('[type="checkbox"]')
|
|
|
|
|
// .eq(1)
|
|
|
|
|
// .should('be.checked')
|
|
|
|
|
// // email me
|
|
|
|
|
// cy.get(".nc-form > .mx-auto")
|
|
|
|
|
// .find('[type="checkbox"]')
|
|
|
|
|
// .eq(2)
|
|
|
|
|
// .should('not.be.checked')
|
|
|
|
|
|
|
|
|
|
cy.closeTableTab("Film"); |
|
|
|
|
}); |
|
|
|
@ -296,29 +326,34 @@ 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"); |
|
|
|
|
// 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"); |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
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.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') |
|
|
|
@ -358,15 +393,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"); |
|
|
|
|
|
|
|
|
@ -374,7 +412,7 @@ export const genTest = (apiType, dbType, testMode) => {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it("Delete Project", () => { |
|
|
|
|
it.skip("Delete Project", () => { |
|
|
|
|
if( testMode === 'AT_IMPORT') { |
|
|
|
|
mainPage.toolBarTopLeft(mainPage.HOME).click({force:true}) |
|
|
|
|
cy.get(`.mdi-delete-outline`, { |
|
|
|
|