-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cypress root page tests #202
Conversation
apoorv1316
commented
Mar 15, 2022
•
edited
Loading
edited
- I have manually tested all workflows
- I have performed a self-review of my own code
- I have added automated tests for my code
Current Code Coverage Percent of this PR:71.72 %Files having coverage below 100%
|
import { dataCy } from "../../support/utils/datacy"; | ||
|
||
export const navbarSelectors = { | ||
dashboardLink: dataCy("dashboard-link"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of naming them as link can you please name them as tabs. for eg. 'clients-tab'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apoorv1316 can you pls change to tab instead of link? rest is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cy.get(navbarSelectors.clientsLink).should("be.visible"); | ||
cy.get(navbarSelectors.teamLink).should("be.visible"); | ||
cy.get(navbarSelectors.projectsLink).should("be.visible"); | ||
cy.get(navbarSelectors.invoiceLink).should("not.exist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Employees should only see Time Tracking, Team, Client, and Project links. Please update test.
Additional links - Dashboard, Invoice, and Reports are only for Admin and Owner.
Also, pls add a test for the Owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion of additional links is "not.exist" for the employees. So I think it's fine. Also, owners and admin have the same tabs so that's why no test for the owner. Also on the icebox card, only admin and employee role is mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohinid the test failed because I have added datacy to multiple elements in this pr itself and it's not merged so it can't find the datacy. I have checked it on local it works fine. Once we add filters for the branches it will be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apoorv1316 would be good to add tests for owner too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please address the changes requested in the comments. Also, pls check the dashboard as these cypress tests are failing.