forked from tsai/budibase
9 changed files with 91 additions and 42 deletions
@ -1,41 +1,70 @@ |
|||||
context('Create a Table', () => { |
context('Create a Table', () => { |
||||
|
|
||||
before(() => { |
before(() => { |
||||
cy.visit('localhost:4001/_builder') |
cy.visit('localhost:4001/_builder') |
||||
cy.createApp('Table App', 'Table App Description') |
cy.createApp('Table App', 'Table App Description') |
||||
}) |
}) |
||||
|
|
||||
// https://on.cypress.io/interacting-with-elements
|
|
||||
it('should create a new Table', () => { |
it('should create a new Table', () => { |
||||
|
|
||||
cy.createTable('dog') |
cy.createTable('dog') |
||||
|
|
||||
// Check if Table exists
|
// Check if Table exists
|
||||
cy.get('.title').should('have.text', 'dog') |
cy.get('.title').should('have.text', 'dog') |
||||
}) |
}) |
||||
|
|
||||
// it('adds a new column to the table', () => {
|
it('adds a new column to the table', () => { |
||||
// cy.addRecord('bob', '15')
|
cy.addColumn('dog', 'name', 'Plain Text') |
||||
|
|
||||
// cy.contains('bob').should('have.text', 'bob')
|
cy.contains('name').should("be.visible") |
||||
// })
|
}) |
||||
|
|
||||
// it('updates a column on the table', () => {
|
it('creates a record in the table', () => { |
||||
// cy.addRecord('bob', '15')
|
cy.addRecord(["Rover"]) |
||||
|
|
||||
|
cy.contains('Rover').should("be.visible") |
||||
|
}) |
||||
|
|
||||
// cy.contains('bob').should('have.text', 'bob')
|
it('updates a column on the table', () => { |
||||
// })
|
cy.contains("name").click() |
||||
|
cy.get("[data-cy='edit-column-header']").click() |
||||
|
|
||||
// it('edits a record', () => {
|
cy.get("[placeholder=Name]").type("updated") |
||||
// cy.addRecord('bob', '15')
|
cy.get("select").select("Plain Text") |
||||
|
|
||||
// cy.contains('bob').should('have.text', 'bob')
|
cy.contains("Save Column").click() |
||||
// })
|
|
||||
|
|
||||
// it('deletes a record', () => {
|
cy.contains('nameupdated').should('have.text', 'nameupdated ') |
||||
// cy.addRecord('bob', '15')
|
}) |
||||
|
|
||||
|
it('edits a record', () => { |
||||
|
cy.get("tbody .ri-more-line").click() |
||||
|
cy.get("[data-cy=edit-row]").click() |
||||
|
cy.get(".actions input").type("updatedRecord") |
||||
|
cy.contains("Save").click() |
||||
|
|
||||
|
cy.contains('updatedRecord').should('have.text', 'updatedRecord') |
||||
|
}) |
||||
|
|
||||
// cy.contains('bob').should('have.text', 'bob')
|
it('deletes a record', () => { |
||||
// })
|
cy.get("tbody .ri-more-line").click() |
||||
|
cy.get("[data-cy=delete-row]").click() |
||||
|
cy.get(".modal-actions").contains("Delete").click() |
||||
|
|
||||
|
cy.contains('updatedRecord').should('not.exist') |
||||
|
}) |
||||
|
|
||||
|
it('deletes a column', () => { |
||||
|
cy.contains("name").click() |
||||
|
cy.get("[data-cy='delete-column-header']").click() |
||||
|
|
||||
|
cy.contains('nameupdated').should('not.exist') |
||||
|
}) |
||||
|
|
||||
|
it('deletes a table', () => { |
||||
|
cy.contains("div", "dog").get(".ri-more-line").click() |
||||
|
cy.get("[data-cy=delete-table]").click() |
||||
|
cy.get(".modal-actions").contains("Delete").click() |
||||
|
|
||||
|
cy.contains('dog').should('not.exist') |
||||
|
}) |
||||
|
|
||||
}) |
}) |
||||
|
|||||
Loading…
Reference in new issue