Skip to content
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

Merged
merged 4 commits into from
Mar 16, 2022
Merged

Cypress root page tests #202

merged 4 commits into from
Mar 16, 2022

Conversation

apoorv1316
Copy link
Collaborator

@apoorv1316 apoorv1316 commented Mar 15, 2022

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@apoorv1316 apoorv1316 requested a review from mohinid March 15, 2022 06:51
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-202 March 15, 2022 06:51 Inactive
@github-actions
Copy link

Current Code Coverage Percent of this PR:

71.72 %

Files having coverage below 100%

Impacted Files Coverage
/app/helpers/application_helper.rb 89.47 %
/app/helpers/team_helper.rb 85.71 %
/app/controllers/concerns/error_handler.rb 73.53 %
/app/controllers/projects_controller.rb 42.86 %
/app/controllers/time_tracking_controller.rb 36.36 %
/app/controllers/concerns/timesheet.rb 37.5 %
/app/controllers/root_controller.rb 42.86 %
/app/controllers/workspaces_controller.rb 77.78 %
/app/controllers/clients_controller.rb 94.44 %
/app/models/timesheet_entry.rb 73.08 %
/app/models/project.rb 90.91 %
/app/policies/timesheet_entry_policy.rb 50.0 %
/app/policies/client_policy.rb 75.0 %
/app/controllers/companies/purge_logo_controller.rb 50.0 %
/app/controllers/users/passwords_controller.rb 41.67 %
/app/controllers/users/omniauth_callbacks_controller.rb 25.0 %
/app/controllers/users/sessions_controller.rb 25.0 %
/app/controllers/users/registrations_controller.rb 42.11 %
/app/controllers/users/invitations_controller.rb 64.29 %
/app/controllers/internal_api/v1/reports_controller.rb 88.89 %
/app/controllers/internal_api/v1/timesheet_entry_controller.rb 42.86 %
/app/controllers/internal_api/v1/workspaces_controller.rb 85.71 %
/app/controllers/internal_api/v1/clients_controller.rb 66.67 %
/lib/authentication/google.rb 0.0 %

import { dataCy } from "../../support/utils/datacy";

export const navbarSelectors = {
dashboardLink: dataCy("dashboard-link"),
Copy link
Contributor

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'

Copy link
Contributor

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.

Copy link
Collaborator Author

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");
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@mohinid mohinid left a 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.

@vipulnsward vipulnsward temporarily deployed to miru-review-pr-202 March 16, 2022 04:34 Inactive
@apoorv1316 apoorv1316 requested a review from mohinid March 16, 2022 04:35
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-202 March 16, 2022 04:46 Inactive
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-202 March 16, 2022 06:37 Inactive
@mohinid mohinid merged commit 2095f14 into develop Mar 16, 2022
@apoorv1316 apoorv1316 deleted the cypress-root-page-test branch March 16, 2022 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants