mirror of https://github.com/nocodb/nocodb
Pranav C
3 years ago
28 changed files with 653 additions and 555 deletions
@ -0,0 +1,42 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Existing table`, () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
|
||||
}); |
||||
|
||||
it('Open Country table', () => { |
||||
|
||||
cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
.contains('Country', {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(Country):visible`).should('exist') |
||||
cy.url().should('contain', `?name=Country&`) |
||||
|
||||
cy.get('td[data-col="Country => City"] div:visible', {timeout: 12000}).first().click() |
||||
cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible').first().click() |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").should('exist') |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").first().click() |
||||
}); |
||||
|
||||
|
||||
}) |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
@ -0,0 +1,46 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Existing table with M2M'`, () => { |
||||
|
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
}) |
||||
|
||||
it('Open Actor table', () => { |
||||
|
||||
|
||||
cy.openTableTab('Actor'); |
||||
|
||||
|
||||
cy.get(`.project-tab:contains(Actor)`).should('exist') |
||||
cy.url().should('contain', `?name=Actor&`) |
||||
|
||||
cy.get('td[data-col="Actor <=> Film"] div', {timeout: 12000}).first().click({force: true}) |
||||
cy.get('td[data-col="Actor <=> Film"] div .mdi-arrow-expand').first().click({force: true}) |
||||
//
|
||||
// cy.get(":contains(Link to 'City')").should('exist')
|
||||
//
|
||||
// cy.get(":contains(Link to 'City'):visible").click()
|
||||
|
||||
cy.get('.child-card:visible').should('exist').first().click() |
||||
|
||||
cy.contains('Save Row').should('exist'); |
||||
|
||||
}); |
||||
|
||||
|
||||
}) |
||||
} |
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
@ -0,0 +1,60 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} Project operations`, () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.signinOrSignup(); |
||||
}) |
||||
beforeEach(() => { |
||||
cy.restoreLocalStorage(); |
||||
}); |
||||
|
||||
afterEach(() => { |
||||
cy.saveLocalStorage(); |
||||
}); |
||||
|
||||
|
||||
it('Create Project', () => { |
||||
cy.contains('New Project').trigger('onmouseover').trigger('mouseenter'); |
||||
cy.get('.create-external-db-project').click() |
||||
cy.url({timeout: 6000}).should('contain', '#/project/') |
||||
if (type === 'graphql') { |
||||
cy.contains('GRAPHQL APIs').closest('label').click() |
||||
} |
||||
cy.get('.database-field input').click().clear().type('dummy_db') |
||||
cy.contains('Test Database Connection').click() |
||||
cy.contains('Ok & Save Project', {timeout: 3000}).click() |
||||
cy.url({timeout: 12000}).should('contain', '#/nc/') |
||||
}); |
||||
|
||||
it('Stop Project', () => { |
||||
cy.visit('./#/projects') |
||||
// cy.get('.nc-rest-project-row .mdi-stop-circle-outline', {timeout: 10000}).last().trigger('onmouseover').trigger('mouseenter')
|
||||
cy.get(`.nc-${type}-project-row .mdi-stop-circle-outline`, {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
it('Start Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get(`.nc-${type}-project-row .mdi-play-circle-outline`, {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Restart Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get(`.nc-${type}-project-row .mdi-restart`, {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Delete Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get(`.nc-${type}-project-row .mdi-delete-circle-outline`, {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
|
||||
}) |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
@ -0,0 +1,124 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Table Column`, () => { |
||||
const randVal = 'Test' + Date.now(); |
||||
const updatedRandVal = 'Updated' + Date.now(); |
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
|
||||
cy.createTable(name) |
||||
}); |
||||
|
||||
// delete table
|
||||
after(() => { |
||||
cy.deleteTable(name) |
||||
}); |
||||
|
||||
it('Create Table Column', () => { |
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
|
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
|
||||
cy.get('.v-window-item--active .nc-grid tr > th:last button').click({force: true}); |
||||
cy.get('.nc-column-name-input input').clear().type('new_column') |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('exist'); |
||||
}); |
||||
|
||||
|
||||
// edit the newly created column
|
||||
it('Edit table column - rename & uidt update', () => { |
||||
|
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover', {force: true}) |
||||
.click({force: true}) |
||||
|
||||
cy.get('.nc-column-edit').click() |
||||
|
||||
|
||||
// change column type and verify
|
||||
cy.get('.nc-ui-dt-dropdown').click() |
||||
cy.contains('LongText').click() |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
|
||||
cy.get('th[data-col="new_column"] .mdi-text-subject').should('exist') |
||||
|
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover', {force: true}) |
||||
.click({force: true}) |
||||
|
||||
cy.get('.nc-column-edit').click() |
||||
|
||||
|
||||
}) |
||||
|
||||
// edit the newly created column
|
||||
it('Edit table column - rename', () => { |
||||
|
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover', {force: true}) |
||||
.click({force: true}) |
||||
|
||||
// rename column and verify
|
||||
cy.get('.nc-column-name-input input').clear().type('updated_column') |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
|
||||
|
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('exist'); |
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('not.exist'); |
||||
|
||||
|
||||
}) |
||||
|
||||
|
||||
// delete the newly created column
|
||||
it('Delete table column', () => { |
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('exist'); |
||||
|
||||
cy.get('th:contains(updated_column) .mdi-menu-down') |
||||
.trigger('mouseover') |
||||
.click() |
||||
|
||||
cy.get('.nc-column-delete').click() |
||||
cy.get('button:contains(Confirm)').click() |
||||
|
||||
|
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('not.exist'); |
||||
|
||||
}) |
||||
|
||||
|
||||
}); |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
||||
|
@ -1,174 +1,62 @@
|
||||
const genTest = (type) => { |
||||
const genTest = (type, meta) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Table`, () => { |
||||
describe(`${meta ? 'Meta - ' : ''}${type.toUpperCase()} api - Table`, () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
new: true, |
||||
meta |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
new: true, |
||||
meta |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
const randVal = 'Test' + Date.now(); |
||||
const updatedRandVal = 'Updated' + Date.now(); |
||||
const name = 'Test' + Date.now(); |
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
}) |
||||
|
||||
// create a new random table
|
||||
it('Create Table', () => { |
||||
cy.get('.add-btn').click(); |
||||
cy.get('.nc-create-table-card .nc-table-name input[type="text"]').first().click().clear().type(name) |
||||
// create a new random table
|
||||
it('Create Table', () => { |
||||
cy.get('.add-btn').click(); |
||||
cy.get('.nc-create-table-card .nc-table-name input[type="text"]').first().click().clear().type(name) |
||||
if (!meta) { |
||||
cy.get('.nc-create-table-card .nc-table-name-alias input[type="text"]').first().should('have.value', name.toLowerCase()) |
||||
cy.wait(5000) |
||||
cy.get('.nc-create-table-card .nc-create-table-submit').first().click() |
||||
cy.get(`.project-tab:contains(${name})`).should('exist') |
||||
cy.url().should('contain', `?name=${name}&`) |
||||
}); |
||||
|
||||
|
||||
// create new row
|
||||
it('Create/Edit/Delete row', () => { |
||||
// add new row
|
||||
cy.get('.nc-add-new-row-btn').click(); |
||||
|
||||
cy.get('#data-table-form-Title > input').first().type(randVal); |
||||
|
||||
cy.contains('Save Row').filter('button').click() |
||||
|
||||
cy.get('td').contains(randVal).should('exist'); |
||||
|
||||
// update row
|
||||
cy.get('td').contains(randVal) |
||||
.closest('tr') |
||||
.find('.nc-row-expand-icon') |
||||
.click(); |
||||
|
||||
|
||||
cy.get('#data-table-form-Title > input').first().clear().type(updatedRandVal); |
||||
cy.contains('Save Row').filter('button').click() |
||||
|
||||
cy.get('td').contains(updatedRandVal).should('exist'); |
||||
cy.get('td').contains(randVal).should('not.exist'); |
||||
|
||||
cy.get('td').contains(updatedRandVal).rightclick() |
||||
|
||||
// delete row
|
||||
cy.getActiveMenu().find('.v-list-item:contains("Delete Row")').first().click() |
||||
cy.wait(1000) |
||||
cy.get('td').contains(randVal).should('not.exist'); |
||||
}) |
||||
|
||||
|
||||
// add new column to newly created table
|
||||
it('Create Table Column', () => { |
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
|
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
|
||||
cy.get('.v-window-item--active .nc-grid tr > th:last button').click({force: true}); |
||||
cy.get('.nc-column-name-input input').clear().type('new_column') |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('exist'); |
||||
}); |
||||
|
||||
// edit the newly created column
|
||||
it('Edit table column - rename & uidt update', () => { |
||||
|
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover', {force: true}) |
||||
.click({force: true}) |
||||
|
||||
cy.get('.nc-column-edit').click() |
||||
|
||||
|
||||
// change column type and verify
|
||||
cy.get('.nc-ui-dt-dropdown').click() |
||||
cy.contains('LongText').click() |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
|
||||
cy.get('th[data-col="new_column"] .mdi-text-subject').should('exist') |
||||
|
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover', {force: true}) |
||||
.click({force: true}) |
||||
|
||||
cy.get('.nc-column-edit').click() |
||||
|
||||
// rename column and verify
|
||||
cy.get('.nc-column-name-input input').clear().type('updated_column') |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
|
||||
|
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('exist'); |
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('not.exist'); |
||||
|
||||
|
||||
}) |
||||
|
||||
|
||||
// delete the newly created column
|
||||
it('Delete table column', () => { |
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('exist'); |
||||
|
||||
cy.get('th:contains(updated_column) .mdi-menu-down') |
||||
.trigger('mouseover') |
||||
.click() |
||||
|
||||
cy.get('.nc-column-delete').click() |
||||
cy.get('button:contains(Confirm)').click() |
||||
|
||||
|
||||
cy |
||||
.get('th:contains(updated_column)') |
||||
.should('not.exist'); |
||||
|
||||
}) |
||||
} |
||||
cy.wait(5000) |
||||
cy.get('.nc-create-table-card .nc-create-table-submit').first().click() |
||||
cy.get(`.project-tab:contains(${name})`).should('exist') |
||||
cy.url().should('contain', `?name=${name}&`) |
||||
}); |
||||
|
||||
|
||||
// delete newly created table
|
||||
it('Delete Table', () => { |
||||
// delete newly created table
|
||||
it('Delete Table', () => { |
||||
|
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
|
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
|
||||
cy.get('.nc-table-delete-btn:visible').click() |
||||
cy.get('.nc-table-delete-btn:visible').click() |
||||
|
||||
cy.get('button:contains(Submit)').click() |
||||
cy.get(`.project-tab:contains(${name}):visible`).first().should('not.exist') |
||||
}); |
||||
cy.get('button:contains(Submit)').click() |
||||
cy.get(`.project-tab:contains(${name}):visible`).first().should('not.exist') |
||||
}); |
||||
|
||||
|
||||
}) |
||||
}); |
||||
}) |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
||||
genTest('rest', true) |
||||
genTest('graphql', true) |
||||
|
||||
|
@ -0,0 +1,71 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Table Row`, () => { |
||||
const randVal = 'Test' + Date.now(); |
||||
const updatedRandVal = 'Updated' + Date.now(); |
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
cy.createTable(name) |
||||
}); |
||||
|
||||
// delete table
|
||||
after(() => { |
||||
cy.deleteTable(name) |
||||
}); |
||||
|
||||
|
||||
it('Add new row', () => { |
||||
cy.get('.nc-add-new-row-btn').click(); |
||||
|
||||
cy.get('#data-table-form-Title > input').first().type(randVal); |
||||
|
||||
cy.contains('Save Row').filter('button').click() |
||||
|
||||
cy.get('td').contains(randVal).should('exist'); |
||||
|
||||
}) |
||||
|
||||
it('Update row', () => { |
||||
cy.get('td').contains(randVal) |
||||
.closest('tr') |
||||
.find('.nc-row-expand-icon') |
||||
.click(); |
||||
|
||||
|
||||
cy.get('#data-table-form-Title > input').first().clear().type(updatedRandVal); |
||||
cy.contains('Save Row').filter('button').click() |
||||
|
||||
|
||||
cy.get('td').contains(updatedRandVal).should('exist'); |
||||
cy.get('td').contains(randVal).should('not.exist'); |
||||
|
||||
}) |
||||
|
||||
|
||||
it('Delete row', () => { |
||||
cy.get('td').contains(updatedRandVal).rightclick() |
||||
|
||||
// delete row
|
||||
cy.getActiveMenu().find('.v-list-item:contains("Delete Row")').first().click() |
||||
cy.wait(1000) |
||||
cy.get('td').contains(randVal).should('not.exist'); |
||||
}) |
||||
|
||||
}); |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
||||
|
@ -0,0 +1,52 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - Table views`, () => { |
||||
|
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
cy.openTableTab('Country'); |
||||
}) |
||||
|
||||
it('Create grid view', () => { |
||||
cy.get('.nc-create-grid-view').click(); |
||||
cy.getActiveModal().find('button:contains(Submit)').click() |
||||
cy.get('.nc-view-item.nc-grid-view-item').should('exist') |
||||
}) |
||||
it('Create gallery view', () => { |
||||
cy.get('.nc-create-gallery-view').click(); |
||||
cy.getActiveModal().find('button:contains(Submit)').click() |
||||
cy.get('.nc-view-item.nc-gallery-view-item').should('exist') |
||||
}) |
||||
/* it('Delete grid view', () => { |
||||
cy.get('.nc-view-item.nc-grid-view-item').then($items => { |
||||
cy.get('.nc-view-item.nc-grid-view-item .nc-view-delete-icon').last().invoke('show').click() |
||||
expect(Cypress.$('.nc-view-item.nc-grid-view-item').length).to.be.lt($items.length) |
||||
}) |
||||
}) |
||||
it('Delete gallery view', () => { |
||||
cy.get('.nc-view-item.nc-gallery-view-item').then($items => { |
||||
cy.get('.nc-view-item.nc-gallery-view-item .nc-view-delete-icon').last().invoke('show').click() |
||||
expect(Cypress.$('.nc-view-item.nc-gallery-view-item').length).to.be.lt($items.length) |
||||
}) |
||||
|
||||
})*/ |
||||
|
||||
|
||||
}) |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
||||
|
@ -0,0 +1,48 @@
|
||||
const genTest = (type) => { |
||||
|
||||
describe(`${type.toUpperCase()} api - User Management`, () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
if (type === 'rest') { |
||||
cy.openOrCreateRestProject({ |
||||
new: true |
||||
}); |
||||
} else { |
||||
cy.openOrCreateGqlProject({ |
||||
new: true |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
const email = `noco${Date.now()}@gmail.com`; |
||||
|
||||
|
||||
it('Add new user', () => { |
||||
cy.get('.v-list-item:contains("Team & Auth")').click(); |
||||
|
||||
cy.get(`.project-tab:contains("Team & Auth"):visible`).should('exist') |
||||
cy.get(`td:contains("pranavc@gmail.com")`).should('exist') |
||||
|
||||
cy.get('button:contains("New User")').first().click() |
||||
|
||||
cy.get('label:contains(Email)').next('input').type(email).trigger('input') |
||||
|
||||
|
||||
cy.get('.nc-invite-or-save-btn').then($el => { |
||||
cy.wrap($el[0]).click() |
||||
|
||||
// cy.contains('.v-alert', /http:\/\/locahost/).should('exist')
|
||||
cy.contains('.v-alert', '#/user/authentication/signup/').should('exist') |
||||
}) |
||||
|
||||
|
||||
}) |
||||
|
||||
|
||||
}) |
||||
} |
||||
|
||||
|
||||
genTest('rest') |
||||
genTest('graphql') |
@ -1,26 +0,0 @@
|
||||
describe('GraphQL api - Existing table', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateGqlProject(); |
||||
}) |
||||
|
||||
it('Open Country table', () => { |
||||
|
||||
cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
.contains('Country', {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(Country):visible`).should('exist') |
||||
cy.url().should('contain', `?name=Country&`) |
||||
|
||||
cy.get('td[data-col="Country => City"] div:visible', {timeout: 12000}).first().click() |
||||
cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible').first().click() |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").should('exist') |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").first().click() |
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,33 +0,0 @@
|
||||
describe('GraphQL api - Existing table with M2M', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateGqlProject(); |
||||
}) |
||||
|
||||
it('Open Actor table', () => { |
||||
|
||||
cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
.contains('Actor', {timeout: 6000}).first().click({force: true}); |
||||
|
||||
|
||||
cy.get(`.project-tab:contains(Actor)`).should('exist') |
||||
cy.url().should('contain', `?name=Actor&`) |
||||
|
||||
cy.get('td[data-col="Actor <=> Film"] div', {timeout:12000}).first().click({force: true}) |
||||
cy.get('td[data-col="Actor <=> Film"] div .mdi-arrow-expand').first().click({force: true}) |
||||
//
|
||||
// cy.get(":contains(Link to 'City')").should('exist')
|
||||
//
|
||||
// cy.get(":contains(Link to 'City'):visible").click()
|
||||
|
||||
cy.get('.child-card:visible').should('exist').first().click() |
||||
|
||||
cy.contains('Save Row').should('exist'); |
||||
cy.contains('Save Row').should('exist'); |
||||
|
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,51 +0,0 @@
|
||||
describe('GraphQL Project operations', () => { |
||||
|
||||
beforeEach(() => { |
||||
cy.restoreLocalStorage(); |
||||
}); |
||||
|
||||
afterEach(() => { |
||||
cy.saveLocalStorage(); |
||||
}); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.signinOrSignup(); |
||||
}) |
||||
|
||||
it('Create Project', () => { |
||||
cy.contains('New Project').trigger('onmouseover').trigger('mouseenter'); |
||||
cy.get('.create-external-db-project').click() |
||||
cy.url({timeout: 6000}).should('contain', '#/project/') |
||||
cy.contains('GRAPHQL APIs').closest('label').click() |
||||
cy.get('.database-field input').click().clear().type('dummy_db') |
||||
cy.contains('Test Database Connection').click() |
||||
cy.contains('Ok & Save Project', {timeout: 3000}).click() |
||||
cy.url({timeout: 12000}).should('contain', '#/nc/') |
||||
}); |
||||
|
||||
it('Stop Project', () => { |
||||
cy.visit('./#/projects') |
||||
// cy.get('.nc-graphql-project-row .mdi-stop-circle-outline', {timeout: 10000}).last().trigger('onmouseover').trigger('mouseenter')
|
||||
cy.get('.nc-graphql-project-row .mdi-stop-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
it('Start Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-graphql-project-row .mdi-play-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Restart Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-graphql-project-row .mdi-restart', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Delete Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-graphql-project-row .mdi-delete-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,72 +0,0 @@
|
||||
describe('GraphQL api - Table', () => { |
||||
|
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
}) |
||||
|
||||
// create a new random table
|
||||
it('Create Table', () => { |
||||
cy.get('.add-btn').click(); |
||||
cy.get('.nc-create-table-card .nc-table-name input[type="text"]').first().click().clear().type(name) |
||||
cy.get('.nc-create-table-card .nc-table-name-alias input[type="text"]').first().should('have.value', name.toLowerCase()) |
||||
cy.wait(5000) |
||||
cy.get('.nc-create-table-card .nc-create-table-submit').first().click() |
||||
cy.get(`.project-tab:contains(${name})`).should('exist') |
||||
cy.url().should('contain', `?name=${name}&`) |
||||
}); |
||||
|
||||
|
||||
// add new column to newly created table
|
||||
it('Create Table Column', () => { |
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
|
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
|
||||
cy.get('.v-window-item--active .nc-grid tr > th:last button').click({force: true}); |
||||
cy.get('.nc-column-name-input input').clear().type('new_column') |
||||
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||
|
||||
}); |
||||
|
||||
// delete the newly created column
|
||||
it('Delete table column', () => { |
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('exist'); |
||||
|
||||
cy.get('th:contains(new_column) .mdi-menu-down') |
||||
.trigger('mouseover') |
||||
.click() |
||||
|
||||
cy.get('.nc-column-delete').click() |
||||
cy.get('button:contains(Confirm)').click() |
||||
|
||||
|
||||
cy |
||||
.get('th:contains(new_column)') |
||||
.should('not.exist'); |
||||
|
||||
}) |
||||
|
||||
|
||||
// delete newly created table
|
||||
it('Delete Table', () => { |
||||
cy.get('.nc-project-tree').find('.v-list-item__title:contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
|
||||
cy.get('.nc-project-tree').contains(name, {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(${name}):visible`).should('exist') |
||||
|
||||
cy.get('.nc-table-delete-btn:visible').click() |
||||
|
||||
cy.get('button:contains(Submit)').click() |
||||
cy.get(`.project-tab:contains(${name}):visible`).first().should('not.exist') |
||||
}); |
||||
}) |
@ -1,26 +0,0 @@
|
||||
describe('Rest api - Existing table', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
}) |
||||
|
||||
it('Open Country table', () => { |
||||
|
||||
cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
.contains('Country', {timeout: 6000}).first().click({force: true}); |
||||
|
||||
cy.get(`.project-tab:contains(Country):visible`).should('exist') |
||||
cy.url().should('contain', `?name=Country&`) |
||||
|
||||
cy.get('td[data-col="Country => City"] div:visible', {timeout: 12000}).first().click() |
||||
cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible').first().click() |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").should('exist') |
||||
|
||||
cy.get(":contains(Link to 'City'):visible").first().click() |
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,33 +0,0 @@
|
||||
describe('Rest api - Existing table with M2M', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
}) |
||||
|
||||
it('Open Actor table', () => { |
||||
|
||||
cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) |
||||
.first().click() |
||||
.contains('Actor', {timeout: 6000}).first().click({force: true}); |
||||
|
||||
|
||||
cy.get(`.project-tab:contains(Actor)`).should('exist') |
||||
cy.url().should('contain', `?name=Actor&`) |
||||
|
||||
cy.get('td[data-col="Actor <=> Film"] div', {timeout:12000}).first().click({force: true}) |
||||
cy.get('td[data-col="Actor <=> Film"] div .mdi-arrow-expand').first().click({force: true}) |
||||
//
|
||||
// cy.get(":contains(Link to 'City')").should('exist')
|
||||
//
|
||||
// cy.get(":contains(Link to 'City'):visible").click()
|
||||
|
||||
cy.get('.child-card:visible').should('exist').first().click() |
||||
|
||||
cy.contains('Save Row').should('exist'); |
||||
cy.contains('Save Row').should('exist'); |
||||
|
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,49 +0,0 @@
|
||||
describe('Rest Project operations', () => { |
||||
beforeEach(() => { |
||||
cy.restoreLocalStorage(); |
||||
}); |
||||
|
||||
afterEach(() => { |
||||
cy.saveLocalStorage(); |
||||
}); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.signinOrSignup(); |
||||
}) |
||||
|
||||
it('Create Project', () => { |
||||
cy.contains('New Project').trigger('onmouseover').trigger('mouseenter'); |
||||
cy.get('.create-external-db-project').click() |
||||
cy.url({timeout: 6000}).should('contain', '#/project/') |
||||
cy.get('.database-field input').click().clear().type('dummy_db') |
||||
cy.contains('Test Database Connection').click() |
||||
cy.contains('Ok & Save Project', {timeout: 3000}).click() |
||||
cy.url({timeout: 12000}).should('contain', '#/nc/') |
||||
}); |
||||
|
||||
it('Stop Project', () => { |
||||
cy.visit('./#/projects') |
||||
// cy.get('.nc-rest-project-row .mdi-stop-circle-outline', {timeout: 10000}).last().trigger('onmouseover').trigger('mouseenter')
|
||||
cy.get('.nc-rest-project-row .mdi-stop-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
it('Start Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-rest-project-row .mdi-play-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Restart Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-rest-project-row .mdi-restart', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
it('Delete Project', () => { |
||||
cy.visit('./#/projects') |
||||
cy.get('.nc-rest-project-row .mdi-delete-circle-outline', {timeout: 10000}).last().invoke('show').click(); |
||||
cy.contains('Submit').closest('button').click(); |
||||
}); |
||||
|
||||
|
||||
}) |
@ -1,36 +0,0 @@
|
||||
describe('Rest api - Table', () => { |
||||
|
||||
const name = 'Test' + Date.now(); |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
cy.openTableTab('Country'); |
||||
}) |
||||
|
||||
it('Create grid view', () => { |
||||
cy.get('.nc-create-grid-view').click(); |
||||
cy.getActiveModal().find('button:contains(Submit)').click() |
||||
cy.get('.nc-view-item.nc-grid-view-item').should('exist') |
||||
}) |
||||
it('Create gallery view', () => { |
||||
cy.get('.nc-create-gallery-view').click(); |
||||
cy.getActiveModal().find('button:contains(Submit)').click() |
||||
cy.get('.nc-view-item.nc-gallery-view-item').should('exist') |
||||
}) |
||||
/* it('Delete grid view', () => { |
||||
cy.get('.nc-view-item.nc-grid-view-item').then($items => { |
||||
cy.get('.nc-view-item.nc-grid-view-item .nc-view-delete-icon').last().invoke('show').click() |
||||
expect(Cypress.$('.nc-view-item.nc-grid-view-item').length).to.be.lt($items.length) |
||||
}) |
||||
}) |
||||
it('Delete gallery view', () => { |
||||
cy.get('.nc-view-item.nc-gallery-view-item').then($items => { |
||||
cy.get('.nc-view-item.nc-gallery-view-item .nc-view-delete-icon').last().invoke('show').click() |
||||
expect(Cypress.$('.nc-view-item.nc-gallery-view-item').length).to.be.lt($items.length) |
||||
}) |
||||
|
||||
})*/ |
||||
|
||||
|
||||
}) |
@ -1,25 +0,0 @@
|
||||
describe('User mana', () => { |
||||
const email = `noco${Date.now()}@gmail.com`; |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
}) |
||||
|
||||
|
||||
it('Add new user', () => { |
||||
cy.get('.v-list-item:contains("Team & Auth")').click(); |
||||
|
||||
cy.get(`.project-tab:contains("Team & Auth"):visible`).should('exist') |
||||
cy.get(`td:contains("pranavc@gmail.com")`).should('exist') |
||||
|
||||
cy.get('button:contains("New User")').first().click() |
||||
|
||||
cy.get('label:contains(Email)').next('input').type(email) |
||||
|
||||
cy.get('.nc-invite-or-save-btn').click() |
||||
|
||||
}) |
||||
|
||||
|
||||
}) |
Loading…
Reference in new issue