8000 test: update dte e2e tests by ashleythedeveloper Β· Pull Request #292 Β· uncefact/tests-untp Β· GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

test: update dte e2e tests #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions e2e/constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ORCHARD_FACILITY = 'Orchard Facility';
export const APP_NAME = 'Example Company';
export const GENERAl_FEATURES = 'General features';
export const APP_CONFIG_FEATURE_APP = 'apps';
export const APP_CONFIG_GENERAL_FEATURES = 'generalFeatures';
Expand All @@ -13,14 +13,18 @@ export const ISSUE_DPP = 'Generate DPP';
export const ISSUE_DCC = 'Generate DCC';
export const ISSUE_DFR = 'Generate DFR';
export const ISSUE_DIA = 'Generate DIA';
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 ISSUE_TRANSACTION_EVENT = 'Generate Transaction Event';
export const ISSUE_TRANSFORMATION_EVENT = 'Generate Transformation Event';
export const ISSUE_OBJECT_EVENT = 'Generate Object Event';
export const ISSUE_ASSOCIATION_EVENT = 'Generate Association Event';
export const ISSUE_AGGREGATION_EVENT = 'Generate Aggregation Event';

export const TRACEABILITY_LINK_TYPE = 'http://localhost:3000/gs1/01/09359502000034/21/123456';
export const DPP_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/21/12345?linkType=gs1:sustainabilityInfo';
export const DCC_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/6789/21/12345678?linkType=gs1:certificationInfo';
export const DFR_LINK_TYPE = 'http://localhost:3000/gs1/gln/1321202290648?linkType=gs1:locationInfo';
export const DIA_LINK_TYPE = 'http://localhost:3000/gs1/01/09359502000010?linkType=gs1:registryEntry';
export const TRANSACTION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00001?linkType=gs1:traceability';
export const TRANSFORMATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00005?linkType=gs1:traceability';
export const OBJECT_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00002?linkType=gs1:traceability';
export const ASSOCIATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00003?linkType=gs1:traceability';
export const AGGREGATION_EVENT_LINK_TYPE = 'http://localhost:3000/gs1/01/09520123456788/10/00004?linkType=gs1:traceability';
13 changes: 4 additions & 9 deletions e2e/cypress/e2e/actor_content_test/actorName.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ describe('Facility Links Test', () => {
it('should visit the homepage and verify the facility links', () => {
// Visit the homepage
cy.visit('/');
// Verify the presence of the "CHERRIES SUPPLY CHAIN TRACEABILITY" text
cy.contains('h5', 'CHERRIES SUPPLY CHAIN TRACEABILITY').should('be.visible');
cy.contains('h5', 'UNTP Reference Implementation').should('be.visible');
});

it('should verify all <a> tags from the second match the expected texts', () => {
const expectedTexts = [
'Orchard Facility',
'Packhouse Facility',
'Fumigation and Freight Forwarding Facility',
'Airport Terminal Facility',
'Example Company',
'Scanning',
'General features',
];
Expand All @@ -34,15 +30,14 @@ describe('Facility Links Test', () => {
});

describe('Facility Links Test', () => {
it('should visit the homepage and click on the "Orchard Facility" link', () => {
it('should visit the homepage and click on the "Example Company" link', () => {
// Visit the homepage
cy.visit('/');

// Locate the Orchard Facility link by its href attribute and class
cy.get('a').eq(1).should('be.visible').and('not.be.disabled').click()

// Verify the URL to confirm navigation
cy.url().should('include', '/orchard-facility');
cy.url().should('include', '/example-company');
// Check if the Submit button appears after clicking
cy.get('a') // Adjust this selector if the button isn't of type submit
.eq(1)
Expand Down
4 changes: 2 additions & 2 deletions e2e/cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DPP_LINK_TYPE } from '../../../../constant';
class DPPIssueFlow extends IssuePage {
testGenerateDPPWorkflow() {
this.generateWorkflow(
'Orchard Facility',
'Example Company',
'Generate DPP',
'DigitalProductPassport',
'apps',
Expand All @@ -27,7 +27,7 @@ describe('Issue DPP end-to-end testing flow', () => {
dppTest.testAppConfig();
});

it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => {
it('should issue DPP', () => {
dppTest.testGenerateDPPWorkflow();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
APP_CONFIG_FEATURE_APP,
DIGITAL_TRACEABILITY_EVENT,
ISSUE_TRACEABILITY_AGGREGATION_EVENT,
ORCHARD_FACILITY,
TRACEABILITY_LINK_TYPE,
ISSUE_AGGREGATION_EVENT,
APP_NAME,
AGGREGATION_EVENT_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', () => {
describe('Issue Aggregation Event end-to-end testing flow', () => {
beforeEach(() => {
aggregationEvent.beforeAll();
});
Expand All @@ -18,20 +18,20 @@ describe('Issue Digital Traceability Aggregation Event end-to-end testing flow',
aggregationEvent.testAppConfig();
});

it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => {
it('should issue Aggregation Event', () => {
aggregationEvent.generateWorkflow(
ORCHARD_FACILITY,
ISSUE_TRACEABILITY_AGGREGATION_EVENT,
APP_NAME,
ISSUE_AGGREGATION_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);
});

it('Verify linkType', () => {
aggregationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE);
aggregationEvent.verifyLinkType(AGGREGATION_EVENT_LINK_TYPE);
});

it('Runs testing UNTP test suite for Digital Traceability Aggregation Event', () => {
aggregationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0');
it('Runs testing UNTP test suite for Aggregation Event', () => {
aggregationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.6.0');
});
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { APP_CONFIG_FEATURE_APP, DIGITAL_TRACEABILITY_EVENT, ISSUE_TRACEABILITY_ASSOCIATION_EVENT, ORCHARD_FACILITY, TRACEABILITY_LINK_TYPE } from 'constant';
import {
APP_CONFIG_FEATURE_APP,
ASSOCIATION_EVENT_LINK_TYPE,
DIGITAL_TRACEABILITY_EVENT,
ISSUE_ASSOCIATION_EVENT,
APP_NAME,
} from 'constant';
import IssuePage from 'cypress/page/issuePage';

const associationEvent = new IssuePage();

describe('Issue Digital Traceability Association Event end-to-end testing flow', () => {
describe('Issue Association Event end-to-end testing flow', () => {
beforeEach(() => {
associationEvent.beforeAll();
});
Expand All @@ -12,21 +18,20 @@ describe('Issue Digital Traceability Association Event end-to-end testing flow',
associationEvent.testAppConfig();
});

it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => {
it('should issue Association Event', () => {
associationEvent.generateWorkflow(
ORCHARD_FACILITY,
ISSUE_TRACEABILITY_ASSOCIATION_EVENT,
APP_NAME,
ISSUE_ASSOCIATION_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);

});

it('Verify linkType', () => {
associationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE);
associationEvent.verifyLinkType(ASSOCIATION_EVENT_LINK_TYPE);
});

it('Runs testing UNTP test suite for Digital Traceability Association Event', () => {
associationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0');
it('Runs testing UNTP test suite for Association Event', () => {
associationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.6.0');
});
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
APP_CONFIG_FEATURE_APP,
DIGITAL_TRACEABILITY_EVENT,
ISSUE_TRACEABILITY_OBJECT_EVENT,
ORCHARD_FACILITY,
TRACEABILITY_LINK_TYPE,
ISSUE_OBJECT_EVENT,
OBJECT_EVENT_LINK_TYPE,
APP_NAME,
} from 'constant';
import IssuePage from 'cypress/page/issuePage';

const objectEvent = new IssuePage();

describe('Issue Digital Traceability Object Event end-to-end testing flow', () => {
describe('Issue Object Event end-to-end testing flow', () => {
beforeEach(() => {
objectEvent.beforeAll();
});
Expand All @@ -18,20 +18,20 @@ describe('Issue Digital Traceability Object Event end-to-end testing flow', () =
objectEvent.testAppConfig();
});

it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => {
it('should issue Object Event', () => {
objectEvent.generateWorkflow(
ORCHARD_FACILITY,
ISSUE_TRACEABILITY_OBJECT_EVENT,
APP_NAME,
ISSUE_OBJECT_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);
});

it('Verify linkType', () => {
objectEvent.verifyLinkType(TRACEABILITY_LINK_TYPE);
objectEvent.verifyLinkType(OBJECT_EVENT_LINK_TYPE);
});

it('Runs testing UNTP test suite for Digital Traceability Object Event', () => {
objectEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0');
it('Runs testing UNTP test suite for Object Event', () => {
objectEvent.runUntpTest('digitalTraceabilityEvent', 'v0.6.0');
});
});
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
import {
APP_CONFIG_FEATURE_APP,
DIGITAL_PRODUCT_PASSPORT,
DIGITAL_TRACEABILITY_EVENT,
ISSUE_DPP,
MOVE_TO_NEXT_FACILITY,
ORCHARD_FACILITY,
TRACEABILITY_LINK_TYPE,
ISSUE_TRANSACTION_EVENT,
APP_NAME,
TRANSACTION_EVENT_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', () => {
describe('Issue 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('/');

it('should issue Transaction Event', () => {
transactionEvent.generateWorkflow(
ORCHARD_FACILITY,
MOVE_TO_NEXT_FACILITY,
APP_NAME,
ISSUE_TRANSACTION_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);
});

it('Verify linkType', () => {
transactionEvent.verifyLinkType(TRACEABILITY_LINK_TYPE);
transactionEvent.verifyLinkType(TRANSACTION_EVENT_LINK_TYPE);
});

it('Runs testing UNTP test suite for Digital Traceability Transaction Event', () => {
transactionEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0');
it('Runs testing UNTP test suite for Transaction Event', () => {
transactionEvent.runUntpTest('digitalTraceabilityEvent', 'v0.6.0');
});
});
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
APP_CONFIG_FEATURE_APP,
DIGITAL_TRACEABILITY_EVENT,
ISSUE_TRACEABILITY_TRANSFORMATION_EVENT,
ORCHARD_FACILITY,
TRACEABILITY_LINK_TYPE,
ISSUE_TRANSFORMATION_EVENT,
APP_NAME,
TRANSFORMATION_EVENT_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', () => {
describe('Issue Transformation Event end-to-end testing flow', () => {
beforeEach(() => {
transformationEvent.beforeAll();
});
Expand All @@ -18,20 +18,20 @@ describe('Issue Digital Traceability Transformation Event end-to-end testing flo
transformationEvent.testAppConfig();
});

it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => {
it('should issue Transformation Event', () => {
transformationEvent.generateWorkflow(
ORCHARD_FACILITY,
ISSUE_TRACEABILITY_TRANSFORMATION_EVENT,
APP_NAME,
ISSUE_TRANSFORMATION_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);
});

it('Verify linkType', () => {
transformationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE);
transformationEvent.verifyLinkType(TRANSFORMATION_EVENT_LINK_TYPE);
});

it('Runs testing UNTP test suite for Digital Traceability Transformation Event', () => {
transformationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0');
it('Runs testing UNTP test suite for Transformation Event', () => {
transformationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.6.0');
});
});
59 changes: 59 additions & 0 deletions e2e/cypress/e2e/vc_render/render_aggregation_event.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {
APP_CONFIG_FEATURE_APP,
DIGITAL_TRACEABILITY_EVENT,
APP_NAME,
ISSUE_AGGREGATION_EVENT,
AGGREGATION_EVENT_LINK_TYPE,
} from 'constant';
import IssuePage from 'cypress/page/issuePage';
import RenderPage from 'cypress/page/renderPage';

const aggregationEventIssue = new IssuePage();
const aggregationEventRender = new RenderPage();

describe('Render Aggregation Event end-to-end testing flow', () => {
describe('Issue Aggregation Event', () => {
beforeEach(() => {
aggregationEventIssue.beforeAll();
});

it('should issue Aggregation Event', () => {
aggregationEventIssue.generateWorkflow(
APP_NAME,
ISSUE_AGGREGATION_EVENT,
DIGITAL_TRACEABILITY_EVENT,
APP_CONFIG_FEATURE_APP,
);
});
});

describe('should render Aggregation Event', () => {
beforeEach(() => {
cy.visit(AGGREGATION_EVENT_LINK_TYPE);
});

it('should displays the correct page title and content', () => {
aggregationEventRender.verifyPageTitleAndContent();
});

it('should checks the functionality of the RENDERED, JSON, and DOWNLOAD buttons/links', () => {
aggregationEventRender.verifyButtonsVisibilityAndText();
});

it('should download VC when clicking on download', () => {
aggregationEventRender.verifyDownloadVC();
});

it('should render template when content is exist', () => {
aggregationEventRender.verifyTemplateRenderingWhenContentExists();
});

it('should not render any content when template is empty', () => {
aggregationEventRender.verifyNoContentRenderingWhenTemplateIsEmpty();
});

it('should display JSON content when JSON button is clicked', () => {
aggregationEventRender.verifyJSONContentDisplay();
});
});
});
Loading
Loading
0