Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Finished testing BarnKit subtabs #165

Open
wants to merge 3 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
66 changes: 66 additions & 0 deletions farmdata2/farmdata2_modules/cypress/mainFD2.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
describe('Check visibility of the FieldKit, BarnKit, FD2 Config tabs for manager', () => {

beforeEach(() => {
cy.login('manager1', 'farmdata2')
})

it('Check visibility of the FieldKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FieldKit').should('exist')
})

it('Check visibility of the BarnKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('BarnKit').should('exist')
})

it('Check visibility of the FD2 Config', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FD2 Config').should('exist')
})
})

describe('Check visibility of the FieldKit, BarnKit, FD2 Config tabs for worker', () => {

beforeEach(() => {
cy.login('worker1', 'farmdata2')
})

it('Check visibility of the FieldKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FieldKit').should('exist')
})

it('Check visibility of the BarnKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('BarnKit').should('exist')
})

it('Check visibility of the FD2 Config', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FD2 Config').should('not.exist')
})
})

describe('Check visibility of the FieldKit, BarnKit, FD2 Config tabs for guest', () => {

beforeEach(() => {
cy.login('guest', 'farmdata2')
})

it('Check visibility of the FieldKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FieldKit').should('not.exist')
})

it('Check visibility of the BarnKit', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('BarnKit').should('not.exist')
})

it('Check visibility of the FD2 Config', () => {
cy.visit('/farm')
cy.get('.nav-tabs').contains('FD2 Config').should('not.exist')
})
})

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('Test the sub-tabs of the FieldKit tab', () => {
beforeEach(() => {
cy.login('manager1', 'farmdata2')
cy.visit('/farm/fd2-barn-kit')
})

it('Check the BarnKit tab contains sub-tabs for “Info”, “Seeding Report” and “Transplanting Report”', () => {
cy.get('.tabs--secondary').contains('Info').should('exist')
cy.get('.tabs--secondary').contains('Seeding Report').should('exist')
cy.get('.tabs--secondary').contains('Transplanting Report').should('exist')
})

it('Check the order of the tabs is “Info”, “Seeding Report” and then “Transplanting Report”', () => {
cy.get('.tabs--secondary').children().eq(0).contains('Info')
cy.get('.tabs--secondary').children().eq(1).contains('Seeding Report')
cy.get('.tabs--secondary').children().eq(2).contains('Transplanting Report')
})

it('Check there are the correct number of sub-tabs (3 at this time)', () => {
cy.get(".tabs--secondary").children().should('have.length', 3)
})
})