Last active
August 27, 2018 01:46
-
-
Save mledom/516a95f971554f514a3d2d08c6467061 to your computer and use it in GitHub Desktop.
Cypress test checking that our welcome message appears
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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