diff --git a/farmdata2/farmdata2_modules/fd2_school/API/api.html b/farmdata2/farmdata2_modules/fd2_school/API/api.html new file mode 100644 index 0000000000..38c17b5b94 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/API/api.html @@ -0,0 +1,152 @@ + + +
+ +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

{{ title ? title : "Mock Harvest Report" }}

+ + +

Details:

+ + + +
+ + + +

There are no matching records

+
+ + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
+ + +
+ +
+ + + + \ No newline at end of file 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..365841ae2a --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/API2/api2.html @@ -0,0 +1,191 @@ + + +
+ +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

{{ title ? title : "Mock Harvest Report" }}

+ + +

Details:

+ + + +
+ + + +

There are no matching records

+
+ + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
+ + +
+ +
+ + + + \ No newline at end of file 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..b3e3fdee01 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.defaults.spec.js @@ -0,0 +1,40 @@ +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") + + + }) + + it("Check the default start and end dates", () => { + + cy.get("[data-cy=start-date]") + .should("have.value", "2020-05-05") + + cy.get("[data-cy=end-date]") + .should("have.value", "2020-05-15") + }) + + + it("Check the crops in crop dropdown", () => { + + cy.get("[data-cy=crop-drop]").children().eq(0) + .should("have.text", "ARUGULA") + + cy.get("[data-cy=crop-drop]").children().eq(4) + .should("have.text", "BEAN-FAVA") + + cy.get("[data-cy=crop-drop]").children().eq(110) + .should("have.text", "ZUCCHINI") + + cy.get("[data-cy=crop-drop]").children() + .should("have.length", "111") + }) + +}) diff --git a/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js new file mode 100644 index 0000000000..ddbfe0d503 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.generate.spec.js @@ -0,0 +1,36 @@ +describe("Test values after clicking Generate Report", () => { + beforeEach(() => { + cy.login("manager1", "farmdata2") + cy.visit("/farm/fd2-school/e2e") + }) + + it("Check Generate Button", () => { + + cy.get("[data-cy=title-element]") + .should("not.exist") + + cy.get("[data-cy=generate-report-button]").click() + + cy.get("[data-cy=title-element]") + .should("be.visible") + + + }) + it("Check Report Info", () => { + + cy.get("[data-cy=generate-report-button]").click() + + cy.get("[data-cy=report-info]").children().eq(0) + .should("contain.text", "Sample Farm") + + cy.get("[data-cy=report-info]").children().eq(1) + .should("contain.text", "manager1") + + cy.get("[data-cy=language]") + .should("contain.text", "English") + + }) + + + +}) 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..b054fda162 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/E2E/e2e.html @@ -0,0 +1,190 @@ + + +
+ +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

{{ title ? title : "Mock Harvest Report" }}

+ + +

Details:

+ + + +
+ + + +

There are no matching records

+
+ + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
+ + +
+ +
+ + + + \ No newline at end of file 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..73ee01416f --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html @@ -0,0 +1,82 @@ + + +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

+ +
+

My Sample Harvest Report

+

Details:

+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + +
DateAreaCropYieldUnits
05/02/2018Chuau-1Kale10Bunches
05/05/2018SQ7Kale7Bunches
+ + +
+ + \ No newline at end of file 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..a78814a2e8 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/Vue1/vue1.html @@ -0,0 +1,105 @@ + + +
+ +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

{{ title ? title : "Mock Harvest Report" }}

+ + +

Details:

+ + + +
+ + + +
+ + + + + + + + + + + + + + + +
DateAreaCropYieldUnits
{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
+ + +
+ +
+ + + + \ No newline at end of file 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..4054076c6f --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/Vue2/vue2.html @@ -0,0 +1,116 @@ + + +
+ +

+

Harvest Report

+

This page is a mockup of a simplified harvest report.

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

{{ title ? title : "Mock Harvest Report" }}

+ + +

Details:

+ + + +
+ + + +

There are no matching records

+
+ + + + + + + + + + + + + + + + + +
RowDateAreaCropYieldUnits
{{ index + 1 }}{{ cell.date }}{{ cell.area }}{{ cell.crop }}{{ cell.yield }}{{ cell.units }}
+ + +
+ +
+ + + + \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module index 167ca8ef2a..da4e91906b 100644 --- a/farmdata2/farmdata2_modules/fd2_school/fd2_school.module +++ b/farmdata2/farmdata2_modules/fd2_school/fd2_school.module @@ -52,6 +52,60 @@ function fd2_school_menu() { 'weight' => -30, // larger weights appear further right. ); + $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, + ); + + $items['farm/fd2-school/Vue1'] = array( + 'title' => 'Vue1', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('Vue1'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + + $items['farm/fd2-school/Vue2'] = array( + 'title' => 'Vue2', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('Vue2'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + + $items['farm/fd2-school/api'] = array( + 'title' => 'API', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('api'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + + $items['farm/fd2-school/api2'] = array( + 'title' => 'API2', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('api2'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + + $items['farm/fd2-school/E2E'] = array( + 'title' => 'E2E', + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'fd2_school_view', + 'page arguments' => array('E2E'), + 'access arguments' => array('view fd2 school'), + 'weight' => 110, + ); + // Define the name and URL for the default sub-tab that appears when the tab is opened. // Content for this default sub-tab is provided by the 'page arguments' above. $items['farm/fd2-school/info'] = array( 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..829dbb7710 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_school/first.spec.js @@ -0,0 +1,17 @@ +describe('My First Test', () => { + it('Gets, types and asserts', () => { + cy.visit('https://example.cypress.io') + + cy.contains('type').click() + + // Should be on a new URL which + // includes '/commands/actions' + cy.url().should('include', '/commands/actions') + + // Get an input, type into it + cy.get('.action-email').type('fake@email.com') + + // Verify that the value has been updated + cy.get('.action-email').should('have.value', 'fake@email.com') + }) +}) \ No newline at end of file