Skip to content

Commit

Permalink
TC-47 Test cypress e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Jan 16, 2025
1 parent 8b2ab51 commit 78ad976
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/oxid-esales/cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,16 @@ docker compose up -d || {
mv docker-compose.yml.backup docker-compose.yml
exit 1
}
$EXIT_CODE=$?

echo "Waiting for services to stabilize..."
sleep 30

"$SCRIPT_DIR/db_backup.sh" restore
#"$SCRIPT_DIR/db_backup.sh" restore

echo "Displaying Cypress logs..."
docker compose logs cypress || echo "No logs available for Cypress."

exit $EXIT_CODE
NO_MAKE_UP=false

# Parse arguments
Expand All @@ -143,3 +144,13 @@ if [ "$NO_MAKE_UP" == "false" ]; then
else
echo -e "${GREEN}Skipping 'make up' as per user request (--no_make_up=true).${NC}"
fi


# Exit with the Cypress exit code
if [ $EXIT_CODE -eq 0 ]; then
echo "Cypress tests passed successfully!"
exit 0
else
echo "Cypress tests failed with exit code: $EXIT_CODE"
exit $EXIT_CODE
fi
26 changes: 26 additions & 0 deletions tests/e2e/cypress/frontend_tests/home_page_test.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@ describe('Login Test', () => {
cy.wait(1000);

cy.get('.sticky-md-top button.btn.btn-highlight.btn-lg.w-100')
.click({ force: true });

cy.get('#brandTypeSelect + .select2')
.click();

// Then click on the VISA option
cy.get('.select2-results__option:contains("VISA")')
.click();

// Now continue with filling in the card details
cy.get('#cardNumber')
.should('be.visible')
.type('4921 8180 8989 8988');

cy.get('#expiryMonth')
.select('12');

cy.get('#expiryYear')
.select('2025');

cy.get('#cardCode_masked')
.type('999');

cy.wait(3000);

cy.get('#buttonRow #nextBtn')
.should('be.visible')
.click();

Expand Down

0 comments on commit 78ad976

Please sign in to comment.