-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add e2e test for transformation traceability event (#216)
* test: add e2e test for transformation traceability event * test: implement traceability event
- Loading branch information
Showing
9 changed files
with
2,859 additions
and
1,330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const ORCHARD_FACILITY = 'Orchard Facility'; | ||
export const APP_CONFIG_FEATURE_APP = 'apps'; | ||
|
||
export const DIGITAL_TRACEABILITY_EVENT = 'DigitalTraceabilityEvent'; | ||
export const DIGITAL_PRODUCT_PASSPORT = 'DigitalProductPassport'; | ||
|
||
export const ISSUE_DPP = 'Issue DPP'; | ||
export const ISSUE_TRACEABILITY_TRANSFORMATION_EVENT = 'Issue Traceability Transformation Event'; | ||
export const ISSUE_TRACEABILITY_OBJECT_EVENT = 'Issue Traceability Object Event'; | ||
export const ISSUE_TRACEABILITY_ASSOCIATION_EVENT = 'Issue Traceability Association Event'; | ||
export const ISSUE_TRACEABILITY_AGGREGATION_EVENT = 'Issue Traceability Aggregation Event'; | ||
export const MOVE_TO_NEXT_FACILITY = 'Move to Next Facility'; | ||
|
||
export const TRACEABILITY_LINK_TYPE = 'http://localhost:3000/gs1/01/09359502000034/21/123456'; |
37 changes: 37 additions & 0 deletions
37
e2e/cypress/e2e/issue_workflow_test/Traceability/issueAggregationEvent.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
APP_CONFIG_FEATURE_APP, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
ISSUE_TRACEABILITY_AGGREGATION_EVENT, | ||
ORCHARD_FACILITY, | ||
TRACEABILITY_LINK_TYPE, | ||
} from 'constant'; | ||
import IssuePage from 'cypress/page/issuePage'; | ||
|
||
const aggregationEvent = new IssuePage(); | ||
|
||
describe('Issue Digital Traceability Aggregation Event end-to-end testing flow', () => { | ||
beforeEach(() => { | ||
aggregationEvent.beforeAll(); | ||
}); | ||
|
||
it('should access the right the app config data', () => { | ||
aggregationEvent.testAppConfig(); | ||
}); | ||
|
||
it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { | ||
aggregationEvent.generateWorkflow( | ||
ORCHARD_FACILITY, | ||
ISSUE_TRACEABILITY_AGGREGATION_EVENT, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
APP_CONFIG_FEATURE_APP, | ||
); | ||
}); | ||
|
||
it('Verify linkType', () => { | ||
aggregationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); | ||
}); | ||
|
||
it('Runs testing UNTP test suite for Digital Traceability Aggregation Event', () => { | ||
aggregationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
e2e/cypress/e2e/issue_workflow_test/Traceability/issueAssociationEvent.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { APP_CONFIG_FEATURE_APP, DIGITAL_TRACEABILITY_EVENT, ISSUE_TRACEABILITY_ASSOCIATION_EVENT, ORCHARD_FACILITY, TRACEABILITY_LINK_TYPE } from 'constant'; | ||
import IssuePage from 'cypress/page/issuePage'; | ||
|
||
const associationEvent = new IssuePage(); | ||
|
||
describe('Issue Digital Traceability Association Event end-to-end testing flow', () => { | ||
beforeEach(() => { | ||
associationEvent.beforeAll(); | ||
}); | ||
|
||
it('should access the right the app config data', () => { | ||
associationEvent.testAppConfig(); | ||
}); | ||
|
||
it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { | ||
associationEvent.generateWorkflow( | ||
ORCHARD_FACILITY, | ||
ISSUE_TRACEABILITY_ASSOCIATION_EVENT, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
APP_CONFIG_FEATURE_APP, | ||
); | ||
|
||
}); | ||
|
||
it('Verify linkType', () => { | ||
associationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); | ||
}); | ||
|
||
it('Runs testing UNTP test suite for Digital Traceability Association Event', () => { | ||
associationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
e2e/cypress/e2e/issue_workflow_test/Traceability/issueObjectEvent.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
APP_CONFIG_FEATURE_APP, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
ISSUE_TRACEABILITY_OBJECT_EVENT, | ||
ORCHARD_FACILITY, | ||
TRACEABILITY_LINK_TYPE, | ||
} from 'constant'; | ||
import IssuePage from 'cypress/page/issuePage'; | ||
|
||
const objectEvent = new IssuePage(); | ||
|
||
describe('Issue Digital Traceability Object Event end-to-end testing flow', () => { | ||
beforeEach(() => { | ||
objectEvent.beforeAll(); | ||
}); | ||
|
||
it('should access the right the app config data', () => { | ||
objectEvent.testAppConfig(); | ||
}); | ||
|
||
it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { | ||
objectEvent.generateWorkflow( | ||
ORCHARD_FACILITY, | ||
ISSUE_TRACEABILITY_OBJECT_EVENT, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
APP_CONFIG_FEATURE_APP, | ||
); | ||
}); | ||
|
||
it('Verify linkType', () => { | ||
objectEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); | ||
}); | ||
|
||
it('Runs testing UNTP test suite for Digital Traceability Object Event', () => { | ||
objectEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); | ||
}); | ||
}); |
45 changes: 45 additions & 0 deletions
45
e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransactionEvent.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { | ||
APP_CONFIG_FEATURE_APP, | ||
DIGITAL_PRODUCT_PASSPORT, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
ISSUE_DPP, | ||
MOVE_TO_NEXT_FACILITY, | ||
ORCHARD_FACILITY, | ||
TRACEABILITY_LINK_TYPE, | ||
} from 'constant'; | ||
import IssuePage from 'cypress/page/issuePage'; | ||
|
||
const transactionEvent = new IssuePage(); | ||
const dppIssue = new IssuePage(); | ||
|
||
describe('Issue Digital Traceability Transaction Event end-to-end testing flow', () => { | ||
beforeEach(() => { | ||
transactionEvent.beforeAll(); | ||
cy.clearLocalStorage(); | ||
}); | ||
|
||
it('should access the right the app config data', () => { | ||
transactionEvent.testAppConfig(); | ||
}); | ||
|
||
it('should issue DPP first and then issue Digital Traceability Transaction Event', () => { | ||
dppIssue.generateWorkflow(ORCHARD_FACILITY, ISSUE_DPP, DIGITAL_PRODUCT_PASSPORT, APP_CONFIG_FEATURE_APP); | ||
|
||
cy.visit('/'); | ||
|
||
transactionEvent.generateWorkflow( | ||
ORCHARD_FACILITY, | ||
MOVE_TO_NEXT_FACILITY, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
APP_CONFIG_FEATURE_APP, | ||
); | ||
}); | ||
|
||
it('Verify linkType', () => { | ||
transactionEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); | ||
}); | ||
|
||
it('Runs testing UNTP test suite for Digital Traceability Transaction Event', () => { | ||
transactionEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); | ||
}); | ||
}); |
37 changes: 37 additions & 0 deletions
37
e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransformationEvent.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
APP_CONFIG_FEATURE_APP, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
ISSUE_TRACEABILITY_TRANSFORMATION_EVENT, | ||
ORCHARD_FACILITY, | ||
TRACEABILITY_LINK_TYPE, | ||
} from 'constant'; | ||
import IssuePage from 'cypress/page/issuePage'; | ||
|
||
const transformationEvent = new IssuePage(); | ||
|
||
describe('Issue Digital Traceability Transformation Event end-to-end testing flow', () => { | ||
beforeEach(() => { | ||
transformationEvent.beforeAll(); | ||
}); | ||
|
||
it('should access the right the app config data', () => { | ||
transformationEvent.testAppConfig(); | ||
}); | ||
|
||
it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { | ||
transformationEvent.generateWorkflow( | ||
ORCHARD_FACILITY, | ||
ISSUE_TRACEABILITY_TRANSFORMATION_EVENT, | ||
DIGITAL_TRACEABILITY_EVENT, | ||
APP_CONFIG_FEATURE_APP, | ||
); | ||
}); | ||
|
||
it('Verify linkType', () => { | ||
transformationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); | ||
}); | ||
|
||
it('Runs testing UNTP test suite for Digital Traceability Transformation Event', () => { | ||
transformationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); | ||
}); | ||
}); |
Oops, something went wrong.