Skip to content

Commit

Permalink
Update of cypress tests + makefile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-de-vera committed Jun 17, 2024
1 parent 6142a19 commit db745d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)


RELEASE_TAG ?= $(shell git describe)
RELEASE_OSES ?= linux
RELEASE_ARCHES ?= amd64 arm64
Expand Down Expand Up @@ -52,12 +51,11 @@ release-images.txt:

tag-release:
(cd k8s/base && kustomize edit set image signadot/hotrod:$(RELEASE_TAG))
git commit -m tag-release-$(RELEASE_TAG) k8s/base
git tag -a -m release-$(RELEASE_TAG) $(RELEASE_TAG)
git push origin $(RELEASE_TAG)
git diff-index --quiet HEAD || git commit -m tag-release-$(RELEASE_TAG) k8s/base
git tag -a -f -m release-$(RELEASE_TAG) $(RELEASE_TAG)
git push origin -f $(RELEASE_TAG)

release: build-release release-images.txt tag-release

for os in $(RELEASE_OSES); do \
for arch in $(RELEASE_ARCHES); do \
GOOS=$$os GOARCH=$$arch $(MAKE) push-docker; \
Expand Down
30 changes: 18 additions & 12 deletions cypress/e2e/hotrod.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,41 @@ describe('hotrod spec', () => {
})

cy.visit(frontendURL);
cy.get('#requestRide').click();
cy.get(':nth-child(1) > .col').click();
cy.get(':nth-child(7) > .col > .text-success').click();
cy.get(':nth-child(7) > .col > .text-success').contains(/Driver (.*) arriving in (.*)./);
cy.get(':nth-child(1) > .chakra-select__wrapper > .chakra-select').select('1');
cy.get(':nth-child(3) > .chakra-select__wrapper > .chakra-select').select('123');
cy.get('.chakra-button').click();

// check if the driver has been delivered
cy.get(':nth-child(6) > .css-bjcoli').contains(/Driver (.*) arriving in (.*)./);

// check routing context
var frontendSandboxName = Cypress.env('FRONTEND_SANDBOX_NAME');
cy.get('.css-8g8ihq :nth-child(2) > :nth-child(2)').should('have.text', 'frontend');
if (frontendSandboxName === "") {
cy.get(':nth-child(3) > .col > .frontend').should('have.text', 'frontend (baseline)');
cy.get(':nth-child(2) > :nth-child(3)').should('have.text', '(baseline)');
} else {
cy.get(':nth-child(3) > .col > .frontend').should('have.text', 'frontend (sandbox=' + frontendSandboxName + ')');
cy.get(':nth-child(2) > :nth-child(3)').should('have.text', '(' + frontendSandboxName + ')');
}
var locationSandboxName = Cypress.env('LOCATION_SANDBOX_NAME');
cy.get('.css-8g8ihq :nth-child(3) > :nth-child(2)').should('have.text', 'location');
if (locationSandboxName === "") {
cy.get(':nth-child(4) > .col > .location').should('have.text', 'location (baseline)');
cy.get(':nth-child(3) > :nth-child(3)').should('have.text', '(baseline)');
} else {
cy.get(':nth-child(4) > .col > .location').should('have.text', 'location (sandbox=' + locationSandboxName + ')');
cy.get(':nth-child(3) > :nth-child(3)').should('have.text', '(' + locationSandboxName + ')');
}
var routeSandboxName = Cypress.env('ROUTE_SANDBOX_NAME');
cy.get(':nth-child(5) > :nth-child(2)').should('have.text', 'route');
if (routeSandboxName === "") {
cy.get(':nth-child(6) > .col > .route').should('have.text', 'route (baseline)');
cy.get(':nth-child(5) > :nth-child(3)').should('have.text', '(baseline)');
} else {
cy.get(':nth-child(6) > .col > .route').should('have.text', 'route (sandbox=' + routeSandboxName + ')');
cy.get(':nth-child(5) > :nth-child(3)').should('have.text', '(' + routeSandboxName + ')');
}
var driverSandboxName = Cypress.env('DRIVER_SANDBOX_NAME');
cy.get(':nth-child(6) > :nth-child(2)').should('have.text', 'driver');
if (driverSandboxName === "") {
cy.get(':nth-child(7) > .col > .driver').should('have.text', 'driver (baseline)');
cy.get(':nth-child(6) > :nth-child(3)').should('have.text', '(baseline)');
} else {
cy.get(':nth-child(7) > .col > .driver').should('have.text', 'driver (sandbox=' + driverSandboxName + ')');
cy.get(':nth-child(6) > :nth-child(3)').should('have.text', '(' + driverSandboxName + ')');
}
});
})

0 comments on commit db745d2

Please sign in to comment.