0/3 threads resolved
added MR::Awaiting Review Squad::Yellow scoped labels
changed the description
21 Setting a `cy.wait(1000)` may seem like the quickest way to make a test pass, but if the server has a hiccup, your test will flake. Best practice is to await requests like below. 22 Using intervals should be reserved for special circumstances, such as waiting for an animation to complete. 23 24 ```javascript 25 cy.server(); 26 cy.route('POST', '**/api/v1/blog/new').as('postBlog'); 27 cy.get('.m-button--submit') 28 .click() 29 .wait('@postBlog').then(xhr => { 30 expect(xhr.status).to.equal(200); 31 expect(xhr.response.body.status).to.equal('success'); 32 }); 33 ``` 34 35 ### Try to avoid 'nth-child' selections 36 It can be tempting to reach for the nth-child selectors when something is not easily identifiable by its CSS class. - Developer
#1 (closed) takeaway right here
44 cy.contains('Post text!`); 45 ``` 46 47 To grab the posts text. If we need to traverse the DOM from the element you have grabbed (such as if we want to hit the like button), we can chain using [parentsUntil()](https://docs.cypress.io/api/commands/parentsuntil.html) and [children()]([parentsUntil()](https://docs.cypress.io/api/commands/children.html)) 48 49 ```javascript 50 cy.contains(postText) 51 .parentsUntil('m-newsfeed__entity') 52 .children() 53 .contains('Like Button') 54 ``` 55 18 56 ### Select with data attributes, not classes 19 57 20 This is Cypress' best practice for finding testable attributes in the DOM, since using HTML selectors to find positions in the DOM is both brittle and flakey. So wherever you see `data-name-of-component`, you'll know it's e2e related. 58 This is Cypress' best practice for finding testable attributes in the DOM, since using HTML selectors to find positions in the DOM is both brittle and flakey. So wherever you see `minds-data-name-of-component`, you'll know it's e2e related. - Developer
I'd emphasis this part more. Like in bold text at the top
25 63 [attr.data-minds-activity-guid]="activity.guid" 26 64 ``` 27 65 28 ### Running tests 66 ### Running Cypress 29 67 30 To run Cypress tests: 68 To run Cypress Tests, check out the cypress folder. In there is a script, e2e.sh, that can be used like so: 69 - Developer
I'd add a bit on how you can easily run this against the review sites and the staging environment