Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it.only('M14012 Focus move to main input box when a character key is selected', () => {
- // 1. Login and go to /
- cy.login('user-1');
- cy.visit('/');
- // 2. Post a message
- const message = 'test for main input box focus';
- cy.get('#post_textbox').type(message + '{enter}');
- // * Check post list content
- cy.get('#postListContent').each((postList) => {
- const divPost = postList[0].children[postList[0].children.length - 1];
- assert.ok(divPost, 'should get the posted message');
- const postId = divPost.id.replace('post_', '');
- // * Check that the message is posted
- cy.get(`#${postId}_message`).should('contain', message);
- // 3. Click on any post to move the focus out of the main input box
- cy.get(`#post_${postId}`).click();
- // 4. Push a character key such as "A"
- cy.get('#post_textbox').type('A');
- // 5. Open the "..." menu on a post in the main or reply thread to move the focus out of the main input box
- cy.get(`#post_${postId}`).trigger('mouseover');
- cy.get(`#CENTER_dropdown_${postId} .dropdown-toggle`).click({force: true});
- // 6. Push a character key such as "A"
- cy.get('#post_textbox').type('A');
- // * Focus is moved back to the main input and the keystroke is captured
- cy.focused().should('have.id', 'post_textbox');
- cy.focused().should('contain', 'AA');
- });
- });
Add Comment
Please, Sign In to add comment