From e925c96ae2f8932a3e4f0a391c85400bcba71af0 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 17:56:16 -0500 Subject: [PATCH 01/10] add HTML sub-tab to FD2 School --- farmdata2/farmdata2_modules/fd2_school/fd2_school.module | 8 ++++++++ farmdata2/farmdata2_modules/fd2_school/html/html.html | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/html/html.html diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 167ca8ef..482a2b56 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -61,6 +61,14 @@ function fd2_school_menu() { ); // Add items blocks for new sub-tabs here. + $items['farm/fd2-school/html'] = array( + 'title' => 'HTML', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('html'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); return $items; }; diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html new file mode 100644 index 00000000..eba5b19d --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -0,0 +1,3 @@ +
+

Gabriel

+
From 2553c9d373998bc529dfc2fe95b8cffccefdbf5e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 18:16:00 -0500 Subject: [PATCH 02/10] update content of HTML subtab within the FD2 School tab --- .../farmdata2_modules/fd2_school/html/html.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index eba5b19d..7cbc5cde 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -1,3 +1,16 @@
-

Gabriel

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

+
+

My Sample Harvest Report

+

Details:

+
    +
  • Farm: Sample Farm
  • +
  • User: manager1
  • +
  • Language: English
  • +
    +
  • Start: 05/01/2018
  • +
  • End: 05/15/2018
  • +
  • Crop: Kale
  • +
From 2cc127d586ffc0f9d5aadf3383c8e9243e127c02 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 19:54:49 -0500 Subject: [PATCH 03/10] add report generation fields --- farmdata2/farmdata2_modules/fd2_school/html/html.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index 7cbc5cde..7c4b618e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -13,4 +13,8 @@

My Sample Harvest Report

  • End: 05/15/2018
  • Crop: Kale
  • +
    + + + From 244283e084ccb4346adaec2510f98eb61e0d38a1 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 20:07:38 -0500 Subject: [PATCH 04/10] add crop field to report generation --- farmdata2/farmdata2_modules/fd2_school/html/html.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index 7c4b618e..b40a253e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -1,6 +1,15 @@

    Harvest Report

    This page is a mockup of a simplified harvest report.

    + +
    + + +

    My Sample Harvest Report

    Details:

    From 25c8888b519d41dea0eed704f4f8340939c0dcab Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 20:09:48 -0500 Subject: [PATCH 05/10] add area field to report generation --- farmdata2/farmdata2_modules/fd2_school/html/html.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index b40a253e..d2618b72 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -8,7 +8,14 @@

    Harvest Report

    - + + + +

    My Sample Harvest Report

    From 7663f3bde0967dc0e60d33399202d58ca864cfc7 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 20:17:09 -0500 Subject: [PATCH 06/10] add start and end date fields to report generation --- .../fd2_school/html/html.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index d2618b72..fe8da625 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -1,22 +1,37 @@

    Harvest Report

    This page is a mockup of a simplified harvest report.

    + -
    + + +

    + + + + + + +

    + + -
    + +

    + +

    My Sample Harvest Report

    Details:

    From 5e059996d6374c7bced460b3176a4b971bebce67 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 8 Feb 2024 20:33:05 -0500 Subject: [PATCH 07/10] add report table --- .../fd2_school/html/html.html | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/html/html.html b/farmdata2/farmdata2_modules/fd2_school/html/html.html index fe8da625..ca6316ec 100644 --- a/farmdata2/farmdata2_modules/fd2_school/html/html.html +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -31,8 +31,9 @@

    Harvest Report



    - +
    +

    My Sample Harvest Report

    Details:

      @@ -44,8 +45,30 @@

      My Sample Harvest Report

    • End: 05/15/2018
    • Crop: Kale
    +
    - - - + + + + + + + + + + + + + + + + + + + + + + + +
    DateAreaCropYieldUnits
    05/02/2018Chuau-1Kale10Bunches
    05/05/2018SQ7Kale7Bunches
    From c8d3a3fe41fe6b0a6954ef0af0bfee066b328b98 Mon Sep 17 00:00:00 2001 From: MaxiSanc37 Date: Tue, 9 Apr 2024 15:33:46 -0400 Subject: [PATCH 08/10] Created the initial test file seedingInput.data.defaults.spec.js and created the initial test structure --- .../seedingInput.data.defaults.spec.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js new file mode 100644 index 00000000..aad88712 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js @@ -0,0 +1,32 @@ +describe('Tests the default contents of the Data section of the Seeding Input Form', () => { + beforeEach(() => { + cy.login('manager1', 'farmdata2') + + // Cypress clears the local storage between each test. + // So we need to save it at the end of each test (see afterEach) + // and then restore beore each test (here). + cy.restoreLocalStorage() + cy.visit('/farm/fd2-field-kit/seedingInput') + }) + + afterEach(() => { + // Save the local storage at the end of each test so + // that it can be restored at the start of the next + cy.saveLocalStorage() + }) + + //Gabe + it('', () => { + + }) + + //Spencer + it('', () => { + + }) + + //Maximo + it('', () => { + + }) +}) \ No newline at end of file From 218afc1aeb507293102b90089f0c50f21e03dbe9 Mon Sep 17 00:00:00 2001 From: MaxiSanc37 Date: Tue, 9 Apr 2024 16:40:29 -0400 Subject: [PATCH 09/10] Added test that ensures the crop dropdown element has no selected value and the correct list of crops --- .../seedingInput/seedingInput.data.defaults.spec.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js index aad88712..cd4dbec7 100644 --- a/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js +++ b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.data.defaults.spec.js @@ -26,7 +26,12 @@ describe('Tests the default contents of the Data section of the Seeding Input Fo }) //Maximo - it('', () => { - + it('Tests the crop dropdown so that it does not have a selected value and the correct crop list', () => { + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input]").should("have.text", "") + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input] > [data-cy=option0]").should("have.text", "ARUGULA") + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input] > [data-cy=option8]").should("have.text", "BROCCOLI") + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input] > [data-cy=option32]").should("have.text", "GARLIC-SCAPES") + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input] > [data-cy=option110]").should("have.text", "ZUCCHINI") + cy.get("[data-cy=crop-selection] > [data-cy=dropdown-input]").children().should("have.length", 111) }) }) \ No newline at end of file From 78c6f530abb158a04319ce6bf1b9419e1aa85c40 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 23 Apr 2024 15:09:11 -0400 Subject: [PATCH 10/10] test for message stating that there are no tables logs on Seeding Report page --- .../seedingReport.message.spec.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReport.message.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReport.message.spec.js b/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReport.message.spec.js new file mode 100644 index 00000000..68b3b8fb --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReport.message.spec.js @@ -0,0 +1,29 @@ +describe('Test the message of the BarnKit Seeding Report if there are no logs', () => { + beforeEach(() => { + cy.login('manager1', 'farmdata2') + + // Cypress clears the local storage between each test. + // So we need to save it at the end of each test (see afterEach) + // and then restore before each test (here). + cy.restoreLocalStorage() + cy.visit('/farm/fd2-barn-kit/seedingReport') + }) + + afterEach(() => { + // Save the local storage at the end of each test so + // that it can be restored at the start of the next + cy.saveLocalStorage() + }) + + it('Test the text of the message if there are no rows in the table', () => { + cy.get('[data-cy=start-date-select]') + .type('2024-01-01') + cy.get('[data-cy=end-date-select]') + .type('2024-01-02') + cy.get('[data-cy=generate-rpt-btn]') + .click() + + cy.get('[data-cy=no-logs-message]') + .contains('No Logs Found in These Dates') + }) +}) \ No newline at end of file