mirror of https://github.com/nocodb/nocodb
Pranav C
3 years ago
10 changed files with 194 additions and 37 deletions
@ -1,20 +0,0 @@
|
||||
describe('Rest api project test', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateGqlProject(); |
||||
}) |
||||
|
||||
it('Create Table', () => { |
||||
cy.get('.add-btn').click(); |
||||
const name = 'Test' + Date.now(); |
||||
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}&`) |
||||
}); |
||||
|
||||
|
||||
}) |
@ -0,0 +1,72 @@
|
||||
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') |
||||
}); |
||||
}) |
@ -0,0 +1,18 @@
|
||||
describe('Rest api - CRUD/Filter', () => { |
||||
|
||||
before(() => { |
||||
cy.waitForSpinners(); |
||||
cy.openOrCreateRestProject(); |
||||
|
||||
// open country table
|
||||
cy.openTableTab('Country'); |
||||
|
||||
}) |
||||
|
||||
// create a new random table
|
||||
it('Check country table - ', () => { |
||||
cy.get('.nc-pagination').should('exist') |
||||
}); |
||||
|
||||
|
||||
}) |
Loading…
Reference in new issue