Skip to content

Instantly share code, notes, and snippets.

@mledom
Last active August 27, 2018 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mledom/516a95f971554f514a3d2d08c6467061 to your computer and use it in GitHub Desktop.
Save mledom/516a95f971554f514a3d2d08c6467061 to your computer and use it in GitHub Desktop.
Cypress test checking that our welcome message appears
describe('"/eletype welcome" should have welcome message with components', () => {
beforeEach(() => {
cy.server();
cy.route('POST', '*conversations.mark*').as('commandReturn');
});
it('Type Welcome command and wait for response', () => {
cy.get('#msg_input > .ql-editor').type('/eletype welcome')
//this is an alias that waits for the return message
//to appear after typing in the command
cy.wait('@commandReturn')
})
it('last message should have "Lets get started', () => {
// get last message and check text
cy.get('[data-qa=\'message_container\']')
.last()
.scrollIntoView()
.contains('Let\'s get started! First, we need to get some information from you. Please click the Settings button below to continue.')
})
it('Check message for "Welcome"', () => {
// get last message and check text
cy.get('[data-qa=\'message_container\']')
.last()
.scrollIntoView()
.contains('Welcome!')
})
it('Check for setting button in welcome message', () => {
cy.get('[data-qa=\'message_container\']')
.last()
.scrollIntoView()
.find('[data-qa=message_attachment_button]')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment