budibase/packages/builder/cypress/integration/createModel.spec.js

26 lines
691 B
JavaScript
Raw Normal View History

2020-06-11 13:20:13 +02:00
context('Create a Model', () => {
2020-06-09 15:40:14 +02:00
before(() => {
2020-06-09 15:40:14 +02:00
cy.visit('localhost:4001/_builder')
// https://on.cypress.io/type
cy.createApp('Model App', 'Model App Description')
2020-06-09 15:40:14 +02:00
})
// https://on.cypress.io/interacting-with-elements
it('should create a new model', () => {
cy.createModel('dog', 'name', 'age')
2020-06-09 15:40:14 +02:00
// Check if model exists
2020-06-09 15:40:14 +02:00
cy.get('.title').should('have.text', 'dog')
})
it('should add a record', () => {
// Page needs to be reloaded for some reason, cookie might be remove between tests?
cy.reload()
2020-06-09 15:40:14 +02:00
cy.addRecord('bob', '15')
2020-06-09 15:40:14 +02:00
cy.contains('bob').should('have.text', 'bob')
})
})