From ae93751067bfefc84e6105f9c30515fa062131cd Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 00:50:53 -0400 Subject: [PATCH 01/12] added html tab --- .../fd2_school/html/html.html | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/html/html.html 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 0000000000..d2d7f99894 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/html/html.html @@ -0,0 +1,69 @@ + +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + +
+ + +
+ +

My Sample Harvest Report

+

Details:

+ + + + + + + + + + + + + + + + + + + + + + + + +
DateAreaCropYieldUnits
05/02/2018Chuau-1Kale10Bunches
05/052018SQ7Kale7Bunches
+ + \ No newline at end of file From 35bac0d0e5eda645c3aefb082d068d64e2a3d47c Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 00:59:01 -0400 Subject: [PATCH 02/12] added vue1 tab --- .../fd2_school/vue1/vue1.html | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html diff --git a/farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html b/farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html new file mode 100644 index 0000000000..449b01e592 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html @@ -0,0 +1,98 @@ + + + Vue Data Binding Spike + + + + +
+ +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + + + + + +
+ + +
+ +

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+ +

Details:

+
    +
  • Farm:Sample Farm
  • +
  • User:manager1
  • +
  • Language:English
  • +
    +
  • Start:{{ startDate }}
  • +
  • End:{{ endDate }}
  • +
  • Crop:{{ selectedCrop }}
  • +
+ + + + + + + + + + + + + + + + +
DateAreaCropYieldUnits
{{ harvestLog.date }}{{ harvestLog.area }}{{ harvestLog.crop }}{{ harvestLog.yield }}{{ harvestLog.units }}
+ +
+ + + + + + \ No newline at end of file From 02ed468cb08f9687f286576731878dd53d548094 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 01:00:41 -0400 Subject: [PATCH 03/12] added vue2 tab --- .../fd2_school/vue2/vue2.html | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html diff --git a/farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html b/farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html new file mode 100644 index 0000000000..1f31c152e1 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html @@ -0,0 +1,108 @@ + + + Vue Data Binding Spike + + + + +
+ +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + + + + + +
+ + +
+ +

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+ +

Details:

+
    +
  • Farm:Sample Farm
  • +
  • User:manager1
  • +
  • Language:English
  • +
    +
  • Start:{{ startDate }}
  • +
  • End:{{ endDate }}
  • +
  • Crop:{{ selectedCrop }}
  • +
+ +

There are no Harvest Logs to be displayed.

+ + + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index }}{{ harvestLog.date }}{{ harvestLog.area }}{{ harvestLog.crop }}{{ harvestLog.yield }}{{ harvestLog.units }}
+ +
+ + + + + + \ No newline at end of file From a6858dcfbb9041d4e46aaf07ed251f159d22a614 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 01:18:04 -0400 Subject: [PATCH 04/12] added api1 tab --- .../fd2_school/api1/api1.html | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/api1/api1.html diff --git a/farmdata2/farmdata2_modules/fd2_school/api1/api1.html b/farmdata2/farmdata2_modules/fd2_school/api1/api1.html new file mode 100644 index 0000000000..9632e7bebb --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/api1/api1.html @@ -0,0 +1,152 @@ + + + Vue Data Binding Spike + + + + +
+ +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + + + + + +
+ + +
+ +

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+ +

Details:

+
    +
  • Farm: {{ farm }}
  • +
  • User: {{ user }}
  • +
  • Language: {{ language }}
  • +
    +
  • Start:{{ startDate }}
  • +
  • End:{{ endDate }}
  • +
  • Crop:{{ selectedCrop }}
  • +
+ +

There are no Harvest Logs to be displayed.

+ + + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index }}{{ harvestLog.date }}{{ harvestLog.area }}{{ harvestLog.crop }}{{ harvestLog.yield }}{{ harvestLog.units }}
+ +
+ + + + + + From 036f699d4d3a2a90d1d7d9b8166b3d3c58396645 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 01:18:44 -0400 Subject: [PATCH 05/12] added api2 tab --- .../fd2_school/api2/api2.html | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/api2/api2.html diff --git a/farmdata2/farmdata2_modules/fd2_school/api2/api2.html b/farmdata2/farmdata2_modules/fd2_school/api2/api2.html new file mode 100644 index 0000000000..abd3ac0f97 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/api2/api2.html @@ -0,0 +1,169 @@ + + + Vue Data Binding Spike + + + + +
+ +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + + + + + +
+ + +
+ +

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+ +

Details:

+
    +
  • Farm: {{ farm }}
  • +
  • User: {{ user }}
  • +
  • Language: {{ language }}
  • +
    +
  • Start:{{ startDate }}
  • +
  • End:{{ endDate }}
  • +
  • Crop:{{ selectedCrop }}
  • +
+ +

There are no Harvest Logs to be displayed.

+ + + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index }}{{ harvestLog.date }}{{ harvestLog.area }}{{ harvestLog.crop }}{{ harvestLog.yield }}{{ harvestLog.units }}
+ +
+ + + + + + \ No newline at end of file From 6233832c3f034ec219d526a819f4e81f6cdbf024 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 13:41:05 -0400 Subject: [PATCH 06/12] added first.spec.js file --- farmdata2/farmdata2_modules/fd2_school/first.spec.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/first.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_school/first.spec.js b/farmdata2/farmdata2_modules/fd2_school/first.spec.js new file mode 100644 index 0000000000..8f9b21e0b0 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/first.spec.js @@ -0,0 +1,5 @@ +describe('empty spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file From 7ccc78b4146c11e8957d4fff239a70c0974d1221 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 14:56:59 -0400 Subject: [PATCH 07/12] updated spec file --- .../fd2_school/e2e/e2e.defaults.spec.js | 11 ++ .../farmdata2_modules/fd2_school/e2e/e2e.html | 169 ++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js create mode 100644 farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js new file mode 100644 index 0000000000..4c4fdc5f66 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js @@ -0,0 +1,11 @@ +describe("Test the harvest report default values", () => { + beforeEach(() => { + cy.login("manager1", "farmdata2") + cy.visit("/farm/fd2-school/e2e") + }) + + it("Check the page header", () => { + cy.get("[data-cy=page-header]") + .should("have.text","Harvest Report") + }) +}) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html new file mode 100644 index 0000000000..a3bd4c129c --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html @@ -0,0 +1,169 @@ + + + Vue Data Binding Spike + + + + +
+ +

Harvest Report

+

This page is a mockup of a simplified harvest report.

+ + + + +
+ + + + + + + +
+ + + + + + + +
+ + +
+ +

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+ +

Details:

+
    +
  • Farm: {{ farm }}
  • +
  • User: {{ user }}
  • +
  • Language: {{ language }}
  • +
    +
  • Start:{{ startDate }}
  • +
  • End:{{ endDate }}
  • +
  • Crop:{{ selectedCrop }}
  • +
+ +

There are no Harvest Logs to be displayed.

+ + + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index }}{{ harvestLog.date }}{{ harvestLog.area }}{{ harvestLog.crop }}{{ harvestLog.yield }}{{ harvestLog.units }}
+ +
+ + + + + + \ No newline at end of file From cdaa4a1cdbe99c7a986f49e419643c3ad0aa2cb1 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 15:24:08 -0400 Subject: [PATCH 08/12] updated spec file --- .../farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js index 4c4fdc5f66..6f35ed8048 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js @@ -8,4 +8,11 @@ describe("Test the harvest report default values", () => { cy.get("[data-cy=page-header]") .should("have.text","Harvest Report") }) + + it("Check if start and end dates are correct", () => { + cy.get("[data-cy=Start-date]") + .should("have.value", "2020-05-05") + cy.get("[data-cy=End-date]") + .should("have.value", "2020-05-15") + }) }) From 2eac4cfdc19b4411677bff00bcc3aaef2cfc5061 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 16:15:20 -0400 Subject: [PATCH 09/12] updated spec file --- farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html index a3bd4c129c..456e64fbdd 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html @@ -16,11 +16,11 @@

Harvest Report


- -
From 64840749f9bd72c03f59866ff5126be1941d03f1 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 16:21:54 -0400 Subject: [PATCH 10/12] updated spec file --- .../fd2_school/e2e/e2e.defaults.spec.js | 11 +++++++++++ farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js index 6f35ed8048..69960c3e4e 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.defaults.spec.js @@ -15,4 +15,15 @@ describe("Test the harvest report default values", () => { cy.get("[data-cy=End-date]") .should("have.value", "2020-05-15") }) + + it("check if crop select is correct", () => { + cy.get("[data-cy=select-crop]").children().eq(0) + .should("have.value", "ARUGULA") + cy.get("[data-cy=select-crop]").children().eq(4) + .should("have.value", "BEAN-FAVA") + cy.get("[data-cy=select-crop]").children().eq(110) + .should("have.value", "ZUCCHINI") + cy.get("[data-cy=select-crop]").children() + .should("have.length", 111) + }) }) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html index 456e64fbdd..06470b85f7 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html @@ -26,7 +26,7 @@

Harvest Report


- From f175b0e02813f4834fe1d6a01b61ec02c84f33ff Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 17:40:10 -0400 Subject: [PATCH 11/12] updated spec file --- .../e2e/e2e.generate.report.spec.js | 24 +++++++++++++++++++ .../farmdata2_modules/fd2_school/e2e/e2e.html | 10 ++++---- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js new file mode 100644 index 0000000000..677fba5a9c --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js @@ -0,0 +1,24 @@ +describe("Test the harvest report User Inputs", () => { + + beforeEach(() => { + cy.login("manager1", "farmdata2") + cy.visit("/farm/fd2-school/e2e") + }) + + it("Check the Generate Report Button", () =>{ + cy.get("[data-cy=report-header]") + .should("not.exist") + cy.get("[data-cy=generate-report-button]").click() + }) + + it("Check generate button - farm info",()=>{ + + cy.get("[data-cy=generate-button]").click() + cy.get("[data-cy=farm-name]") + .should("have.text","Sample Farm") + cy.get("[data-cy=farm-user]") + .should("have.text","manager1") + cy.get("[data-cy=farm-language]") + .should("have.text","English") + }) +}) \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html index 06470b85f7..d0f069d868 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html @@ -36,17 +36,17 @@

Harvest Report


- +
-

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

+

{{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

Details:

    -
  • Farm: {{ farm }}
  • -
  • User: {{ user }}
  • -
  • Language: {{ language }}
  • +
  • Farm: {{ farm }}
  • +
  • User: {{ user }}
  • +
  • Language: {{ language }}

  • Start:{{ startDate }}
  • End:{{ endDate }}
  • From 7edddcfaee66d27e2e3cfffd81adbbffe953d306 Mon Sep 17 00:00:00 2001 From: maliham31 Date: Sat, 3 Jun 2023 20:53:27 -0400 Subject: [PATCH 12/12] fixed cypress test --- .../fd2_school/e2e/e2e.generate.report.spec.js | 16 +++++++++------- .../farmdata2_modules/fd2_school/e2e/e2e.html | 12 ++++++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js index 677fba5a9c..ab8cc73217 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.generate.report.spec.js @@ -5,20 +5,22 @@ describe("Test the harvest report User Inputs", () => { cy.visit("/farm/fd2-school/e2e") }) - it("Check the Generate Report Button", () =>{ + it("Check generate button - harvest report title",()=>{ cy.get("[data-cy=report-header]") .should("not.exist") cy.get("[data-cy=generate-report-button]").click() + cy.get("[data-cy=report-header]") + .should("be.visible") }) it("Check generate button - farm info",()=>{ - cy.get("[data-cy=generate-button]").click() + cy.get("[data-cy=generate-report-button]").click() cy.get("[data-cy=farm-name]") - .should("have.text","Sample Farm") - cy.get("[data-cy=farm-user]") - .should("have.text","manager1") - cy.get("[data-cy=farm-language]") - .should("have.text","English") + .should("have.text"," Sample Farm") + cy.get("[data-cy=user-name]") + .should("have.text"," manager1") + cy.get("[data-cy=language]") + .should("have.text"," English") }) }) \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html index d0f069d868..1f063bfce2 100644 --- a/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html +++ b/farmdata2/farmdata2_modules/fd2_school/e2e/e2e.html @@ -36,17 +36,18 @@

    Harvest Report


    - +
    +

    {{ harvestTitle == '' ? 'Mock Harvest Report' : harvestTitle }}

    Details:

      -
    • Farm: {{ farm }}
    • -
    • User: {{ user }}
    • -
    • Language: {{ language }}
    • +
    • Farm: {{farm}}
    • +
    • User: {{user}}
    • +
    • Language: {{language}}

    • Start:{{ startDate }}
    • End:{{ endDate }}
    • @@ -74,6 +75,7 @@

      {{ harvestTitle == '' ? 'Mock Harvest Report' : harv +

    @@ -81,6 +83,7 @@

    {{ harvestTitle == '' ? 'Mock Harvest Report' : harv var harvestReport = new Vue({ el: '#sample-report', data: { + genState: false, harvestTitle: 'My Sample Harvest Report', startDate: '2020-05-05', endDate: '2020-05-15', @@ -113,6 +116,7 @@

    {{ harvestTitle == '' ? 'Mock Harvest Report' : harv }) }, reqDates: function() { + this.genState = true let link = '/log.json?type=farm_harvest×tamp[ge]=' + dayjs(this.startDate).unix() + '×tamp[le]=' + dayjs(this.endDate).unix() getAllPages(link,this.harvestLogs) }