Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Docs and Developer Site
Docs and Developer Site
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Docs and Developer SiteDocs and Developer Site
  • Merge Requests
  • !13

Open
Opened 1 day ago by Ben Hayward@benhayward.ben
  • Report abuse
Report abuse

Added Cypress docs.

Closes #14

Edited 1 day ago by Ben Hayward

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b "feat/cypress-docs-14" "origin/feat/cypress-docs-14"

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/master"
git merge --no-ff "feat/cypress-docs-14"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge feat/cypress-docs-14 into master
The source branch is 2 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
No approval required
Ready to be merged automatically. Ask someone with write access to this repository to merge this request

Closes #14

Deletes source branch

  • Discussion 3
  • Commits 1
  • Changes 1
0/3 threads resolved
  • Loading...
  • Ben Hayward @benhayward.ben added MR::Awaiting Review Squad::Yellow scoped labels 1 day ago

    added MR::Awaiting Review Squad::Yellow scoped labels

  • Ben Hayward @benhayward.ben changed the description 1 day ago

    changed the description

  • Brian Hatchet
    Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 22 minutes ago
    docs/walk-throughs/frontend-tests.md
    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.
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet · 22 minutes ago
      Developer

      #1 (closed) takeaway right here

    • Please register or sign in to reply
  • Brian Hatchet
    Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 18 minutes ago
    docs/walk-throughs/frontend-tests.md
    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.
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet · 18 minutes ago
      Developer

      I'd emphasis this part more. Like in bold text at the top

    • Please register or sign in to reply
  • Brian Hatchet
    Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 18 minutes ago
    docs/walk-throughs/frontend-tests.md
    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
    • Brian Hatchet
      Brian Hatchet :speech_balloon: @brianhatchet · 18 minutes ago
      Developer

      I'd add a bit on how you can easily run this against the review sites and the staging environment

    • Please register or sign in to reply
  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
None
Assign to
None
Milestone
None
Assign milestone
None
Time tracking
No estimate or time spent
2
Labels
MR::Awaiting Review Squad::Yellow
Assign labels
  • View project labels
Lock merge request
Unlocked
2
2 participants
user avatar
Brian Hatchet
user avatar
Ben Hayward
Reference: minds/docs!13