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

Tests Main FD2 Subtabs Exist #141

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions farmdata2/farmdata2_modules/cypress/subtabs.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('Test the UI tabs are accurate for each kind of person logged into FarmData2', () => {


it('When the manager is logged in the UI should contain FieldKit, BarnKit and FD2 Config tabs', () => {
cy.login('manager1', 'farmdata2')
cy.visit('/farm')
cy.get('a.glyphicons-processed[href="/farm/fd2-field-kit"]').should('exist').and('be.visible');
cy.get('a.glyphicons-processed[href="/farm/fd2-barn-kit"]').should('exist').and('be.visible');
cy.get('a.glyphicons-processed[href="/farm/fd2-config"]').should('exist').and('be.visible');
})

it('When worker is logged in UI should contain FieldKit and BarnKit tabs but not FD2Config tab', () => {
cy.login('worker1', 'farmdata2')
cy.visit('/farm')
cy.get('a.glyphicons-processed[href="/farm/fd2-field-kit"]').should('exist').and('be.visible');
cy.get('a.glyphicons-processed[href="/farm/fd2-barn-kit"]').should('exist').and('be.visible');
cy.get('a.glyphicons-processed[href="/farm/fd2-config"]').should('not.exist')
})

it('When guest is selected none of the three tabs should appear', () => {
cy.login('guest', 'farmdata2')
cy.visit('/farm')
cy.get('a.glyphicons-processed[href="/farm/fd2-field-kit"]').should('not.exist')
cy.get('a.glyphicons-processed[href="/farm/fd2-barn-kit"]').should('not.exist')
cy.get('a.glyphicons-processed[href="/farm/fd2-config"]').should('not.exist')
})
})
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<body>
<div id="transplantingReport" v-cloak>
<h1 class="text-center">Transplanting Report</h1>
<h1 class="text-center" data-cy = "Tr-report">Transplanting Report</h1>
<error-banner data-cy="alert-err-handler" :visible="errBannerVisibility"></error-banner>
<fieldset :disabled="rowBeingEdited" class="panel panel-default center-block" style="width: 50%;">
<legend class="panel-heading" style="background-color: #d62a17; color: white;">Set Dates</legend>
<legend class="panel-heading" style="background-color: #d62a17; color: white;" data-cy = "set-date-label">Set Dates</legend>
<div style="display: flex;width: 100%; padding: 7px">
<date-range-selection data-cy="date-range-selection" class="center-block" @start-date-changed='startDateChange' @end-date-changed='endDateChange'
@click='hide'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Testing for the transplanting report page', () => {
// Wait here for the maps to load in the page.
cy.waitForPage()
})

context('can set dates and then render the report', () => {

it('allows user input of the start and end dates', () => {
Expand Down