From 5865181c9c80e75583fd3108da0c63bc91a503d9 Mon Sep 17 00:00:00 2001 From: QuangPhung15 Date: Thu, 25 Apr 2024 20:43:44 -0400 Subject: [PATCH 1/3] Finished testing Main tab FD2 existed co-authored-by: linhkhanhhoang hoangli@dickinson.edu co-authored-by: HaNguyen03 nguyenhd@dickinson.edu --- .../farmdata2_modules/cypress/mainFD2.spec.js | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 farmdata2/farmdata2_modules/cypress/mainFD2.spec.js diff --git a/farmdata2/farmdata2_modules/cypress/mainFD2.spec.js b/farmdata2/farmdata2_modules/cypress/mainFD2.spec.js new file mode 100644 index 00000000..81b824d4 --- /dev/null +++ b/farmdata2/farmdata2_modules/cypress/mainFD2.spec.js @@ -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') + }) +}) + \ No newline at end of file From 04516883cf1dd9031655ba35671f0a358b3986ec Mon Sep 17 00:00:00 2001 From: QuangPhung15 Date: Fri, 26 Apr 2024 14:08:36 -0400 Subject: [PATCH 2/3] Finished testing BarnKit subtabs co-authored-by: linhkhanhhoang hoangli@dickinson.edu co-authored-by: HaNguyen03@dickinson.edu --- .../cypress/barnKitSubtabs.spec.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js b/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js new file mode 100644 index 00000000..807d9459 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js @@ -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 Info, Seeding Report, and Transplanting Report sub-tabs', () => { + 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 that the order of the tabs: Info, Seeding Report, and 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 that there are only 3 sub-tabs', () => { + cy.get(".tabs--secondary").children().should('have.length', 3) + }) +}) + From 63ad2b92d9b6adf431c5092a0031460d6fddf1e7 Mon Sep 17 00:00:00 2001 From: QuangPhung15 Date: Fri, 26 Apr 2024 14:10:25 -0400 Subject: [PATCH 3/3] Finished testing BarnKit subtabs co-authored-by: linhkhanhhoang hoangli@dickinson.edu co-authored-by: HaNguyen03@dickinson.edu --- .../fd2_barn_kit/cypress/barnKitSubtabs.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js b/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js index 807d9459..aaaf898a 100644 --- a/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js +++ b/farmdata2/farmdata2_modules/fd2_barn_kit/cypress/barnKitSubtabs.spec.js @@ -4,19 +4,19 @@ describe('Test the sub-tabs of the FieldKit tab', () => { cy.visit('/farm/fd2-barn-kit') }) - it('Check Info, Seeding Report, and Transplanting Report sub-tabs', () => { + 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 that the order of the tabs: Info, Seeding Report, and Transplanting Report', () => { + 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 that there are only 3 sub-tabs', () => { + it('Check there are the correct number of sub-tabs (3 at this time)', () => { cy.get(".tabs--secondary").children().should('have.length', 3) }) })