|
|
@ -1,9 +1,10 @@ |
|
|
|
import { loginPage } from "../../support/page_objects/navigation"; |
|
|
|
import { loginPage } from '../../support/page_objects/navigation'; |
|
|
|
import { roles } from "../../support/page_objects/projectConstants"; |
|
|
|
import { roles } from '../../support/page_objects/projectConstants'; |
|
|
|
|
|
|
|
|
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
describe(`${apiType.toUpperCase()} api - Super user test`, () => { |
|
|
|
describe(`${apiType.toUpperCase()} api - Super user test`, () => { |
|
|
|
before(() => {}); |
|
|
|
before(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
@ -13,71 +14,144 @@ export const genTest = (apiType, dbType) => { |
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
after(() => {}); |
|
|
|
after(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Open App store page and check slack app`, () => { |
|
|
|
it(`Open App store page and check slack app`, () => { |
|
|
|
cy.visit("/#/apps").then((win) => { |
|
|
|
cy.visit('/#/apps').then((win) => { |
|
|
|
cy.get(".nc-app-store-title").should("exist"); |
|
|
|
cy.get('.nc-app-store-title').should('exist'); |
|
|
|
cy.get(".nc-app-store-card-Slack").should("exist"); |
|
|
|
cy.get('.nc-app-store-card-Slack').should('exist'); |
|
|
|
|
|
|
|
|
|
|
|
// install slack app
|
|
|
|
// install slack app
|
|
|
|
cy.get(".nc-app-store-card-Slack .install-btn").invoke( |
|
|
|
cy.get('.nc-app-store-card-Slack .install-btn').invoke( |
|
|
|
"attr", |
|
|
|
'attr', |
|
|
|
"style", |
|
|
|
'style', |
|
|
|
"right: 10px" |
|
|
|
'right: 10px' |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
cy.get( |
|
|
|
cy.get( |
|
|
|
".nc-app-store-card-Slack .install-btn .nc-app-store-card-install" |
|
|
|
'.nc-app-store-card-Slack .install-btn .nc-app-store-card-install' |
|
|
|
).click(); |
|
|
|
).click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal(".nc-modal-plugin-install") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-install') |
|
|
|
.find('[placeholder="Channel Name"]') |
|
|
|
.find('[placeholder="Channel Name"]') |
|
|
|
.type("Test channel"); |
|
|
|
.type('Test channel'); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal(".nc-modal-plugin-install") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-install') |
|
|
|
.find('[placeholder="Webhook URL"]') |
|
|
|
.find('[placeholder="Webhook URL"]') |
|
|
|
.type("http://test.com"); |
|
|
|
.type('http://test.com'); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal(".nc-modal-plugin-install") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-install') |
|
|
|
.find('button:contains("Save")') |
|
|
|
.find('button:contains("Save")') |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("Successfully installed"); |
|
|
|
cy.toastWait('Successfully installed'); |
|
|
|
|
|
|
|
|
|
|
|
cy.get( |
|
|
|
cy.get( |
|
|
|
".nc-app-store-card-Slack .install-btn .nc-app-store-card-install" |
|
|
|
'.nc-app-store-card-Slack .install-btn .nc-app-store-card-install' |
|
|
|
).should("not.exist"); |
|
|
|
).should('not.exist'); |
|
|
|
|
|
|
|
|
|
|
|
// update slack app config
|
|
|
|
// update slack app config
|
|
|
|
cy.get(".nc-app-store-card-Slack .install-btn .nc-app-store-card-edit") |
|
|
|
cy.get('.nc-app-store-card-Slack .install-btn .nc-app-store-card-edit') |
|
|
|
.should("exist") |
|
|
|
.should('exist') |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
cy.getActiveModal(".nc-modal-plugin-install") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-install') |
|
|
|
.should("exist") |
|
|
|
.should('exist') |
|
|
|
.find('[placeholder="Channel Name"]') |
|
|
|
.find('[placeholder="Channel Name"]') |
|
|
|
.should("have.value", "Test channel") |
|
|
|
.should('have.value', 'Test channel') |
|
|
|
.clear() |
|
|
|
.clear() |
|
|
|
.type("Test channel 2"); |
|
|
|
.type('Test channel 2'); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal(".nc-modal-plugin-install") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-install') |
|
|
|
.get('button:contains("Save")') |
|
|
|
.get('button:contains("Save")') |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("Successfully installed"); |
|
|
|
cy.toastWait('Successfully installed'); |
|
|
|
|
|
|
|
|
|
|
|
// reset slack app
|
|
|
|
// reset slack app
|
|
|
|
cy.get(".nc-app-store-card-Slack .install-btn .nc-app-store-card-reset") |
|
|
|
cy.get('.nc-app-store-card-Slack .install-btn .nc-app-store-card-reset') |
|
|
|
.should("exist") |
|
|
|
.should('exist') |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal(".nc-modal-plugin-uninstall") |
|
|
|
cy.getActiveModal('.nc-modal-plugin-uninstall') |
|
|
|
.should("exist") |
|
|
|
.should('exist') |
|
|
|
.find('button:contains("Confirm")') |
|
|
|
.find('button:contains("Confirm")') |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("Plugin uninstalled successfully"); |
|
|
|
cy.toastWait('Plugin uninstalled successfully'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`Open super user management page and add/delete user`, () => { |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.visit('/#/account/users').then((win) => { |
|
|
|
|
|
|
|
cy.get('[data-cy="nc-super-user-list"]').should('exist') |
|
|
|
|
|
|
|
.find('tbody tr').should('have.length', 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy=\'nc-super-user-invite\'') |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// additional wait to ensure the modal is fully loaded
|
|
|
|
|
|
|
|
cy.getActiveModal('.nc-modal-invite-user').should('exist'); |
|
|
|
|
|
|
|
cy.getActiveModal('.nc-modal-invite-user') |
|
|
|
|
|
|
|
.find('input[placeholder="E-mail"]') |
|
|
|
|
|
|
|
.should('exist'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal('.nc-modal-invite-user') |
|
|
|
|
|
|
|
.find('input[placeholder="E-mail"]') |
|
|
|
|
|
|
|
.type('test@nocodb.com'); |
|
|
|
|
|
|
|
cy.getActiveModal('.nc-modal-invite-user') |
|
|
|
|
|
|
|
.find('.ant-select.nc-user-roles') |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal('.nc-modal-invite-user') |
|
|
|
|
|
|
|
.find('button.ant-btn-primary') |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait('Successfully added user'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal().find('[data-cy="nc-root-user-invite-modal-close"]').click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="nc-super-user-list"]').should('exist') |
|
|
|
|
|
|
|
.find('tbody tr').should('have.length', 2) |
|
|
|
|
|
|
|
.last().find('[data-cy="nc-super-user-delete"]').click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal().find('.ant-modal-confirm-btns .ant-btn-primary').click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait('User deleted successfully'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="nc-super-user-list"]').should('exist') |
|
|
|
|
|
|
|
.find('tbody tr').should('have.length', 1); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('User management settings', () => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`Token management`, () => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
cy.visit('/#/account/tokens').then((win) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="nc-token-list"]').should('exist').find(':contains("No Data")').should('exist'); |
|
|
|
|
|
|
|
cy.get('[data-cy="nc-token-create"]').click(); |
|
|
|
|
|
|
|
cy.get('[data-cy="nc-token-modal-description"]').type('Descriptqion'); |
|
|
|
|
|
|
|
cy.get('[data-cy="nc-token-modal-save"]').click(); |
|
|
|
|
|
|
|
cy.toastWait('Token created successfully'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('[data-cy="nc-token-list"]').should('exist') |
|
|
|
|
|
|
|
.find('tbody tr').should('have.length', 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|