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

24 lines
632 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(() => {
Cypress.Cookies.preserveOnce('builder:token')
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', () => {
cy.addRecord('bob', '15')
2020-06-09 15:40:14 +02:00
cy.contains('bob').should('have.text', 'bob')
})
})