From 5f61991fdca32839729a74dd9d44620b655cba60 Mon Sep 17 00:00:00 2001 From: Salah Eddine Tazrouti <128312757+stazrouti@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:53:15 +0100 Subject: [PATCH] Revert "Testing" --- .github/workflows/Cypress.yaml | 25 +++++++++++++++ cypress.config.js | 6 ---- cypress/e2e/Home.cy.js | 29 ------------------ cypress/e2e/reservation.cy.js | 56 ---------------------------------- cypress/support/e2e.js | 20 ------------ 5 files changed, 25 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/Cypress.yaml delete mode 100644 cypress/e2e/Home.cy.js delete mode 100644 cypress/e2e/reservation.cy.js delete mode 100644 cypress/support/e2e.js diff --git a/.github/workflows/Cypress.yaml b/.github/workflows/Cypress.yaml new file mode 100644 index 0000000..02b6d72 --- /dev/null +++ b/.github/workflows/Cypress.yaml @@ -0,0 +1,25 @@ +name: Run Cypress Tests + +on: + push: + branches: + - main + +jobs: + cypress: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 14 + + - name: Install Dependencies + run: npm install + + - name: Run Cypress Tests + run: npm run cypress:run diff --git a/cypress.config.js b/cypress.config.js index 8abdb8f..7608335 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -14,10 +14,4 @@ module.exports = defineConfig({ bundler: "webpack", }, }, - - e2e: { - setupNodeEvents(on, config) { - // implement node event listeners here - }, - }, }); diff --git a/cypress/e2e/Home.cy.js b/cypress/e2e/Home.cy.js deleted file mode 100644 index e265299..0000000 --- a/cypress/e2e/Home.cy.js +++ /dev/null @@ -1,29 +0,0 @@ -describe('template spec', () => { - beforeEach(() => { - // Common setup code - cy.visit('http://localhost:3000/'); - - - }); - it('home rendering', () => { - cy.visit('http://localhost:3000/') - cy.contains('Book Ride').click() - //book ride - //Select car - cy.get('select#Select-Your-Car-Type').select('Toyota Camry'); - //Select pickup - cy.get('select#Pick-up').select('Nis'); - //select dropof - cy.get('select#Drop-of').select('Belgrade'); - //select date - cy.get('input#picktime').type('2021-05-05'); - //drop time - cy.get('input#droptime').type('2021-10-05'); - //search book - cy.contains('Search').click(); - }); - - - -}) - diff --git a/cypress/e2e/reservation.cy.js b/cypress/e2e/reservation.cy.js deleted file mode 100644 index 945cf5a..0000000 --- a/cypress/e2e/reservation.cy.js +++ /dev/null @@ -1,56 +0,0 @@ -it('book ride', () => { - cy.visit('http://localhost:3000/') - cy.contains('Book Ride').click() - //book ride - //Select car - cy.get('select#Select-Your-Car-Type').select('Toyota Camry'); - //Select pickup - cy.get('select#Pick-up').select('Nis'); - //select dropof - cy.get('select#Drop-of').select('Belgrade'); - //select date - cy.get('input#picktime').type('2021-05-05'); - //drop time - cy.get('input#droptime').type('2021-10-05'); - //search book - cy.contains('Search').click(); - cy.get('.booking-modal') // replace with the actual selector for your modal - .should('be.visible') // Check if the modal is visible - .contains('Toyota Camry') // Check if the modal contains the text - - cy.get('h6').contains('Pick-Up Location').should('be.visible'); - cy.get('p').contains('Nis').should('be.visible'); - cy.get('h6').contains('Drop-Off Location').should('be.visible'); - cy.get('p').contains('Belgrade').should('be.visible'); - - //complete reservation information - cy.get('input[placeholder="Enter your first name"]').type("Aute et consequatur"); - cy.get('input[placeholder="Enter your first name"]').should('have.value', "Aute et consequatur"); - - cy.get('input[placeholder="Enter your last name"]').type("Aute et consequatur"); - cy.get('input[placeholder="Enter your last name"]').should('have.value', "Aute et consequatur"); - - cy.get('input[placeholder="Enter your phone number"]').type("Aute et consequatur"); - cy.get('input[placeholder="Enter your first name"]').should('have.value', "Aute et consequatur"); - - cy.get('input[placeholder="18"]').type("Aute et consequatur"); - cy.get('input[placeholder="18"]').should('have.value', ""); - cy.get('input[placeholder="18"]').type("20"); - - - cy.get('input[placeholder="Enter your email address"]').type("Aute et consequatur"); - /* cy.get('input[placeholder="Enter your email address"]').should('have.value', ""); */ - - cy.get('input[placeholder="Enter your street address"]').type("Aute et consequatur"); - cy.get('input[placeholder="Enter your street address"]').should('have.value', "Aute et consequatur"); - - cy.get('input[placeholder="Enter your city"]').type("Aute et consequatur"); - cy.get('input[placeholder="Enter your city"]').should('have.value', "Aute et consequatur"); - - cy.get('input[placeholder="Enter your zip code"]').type("1234"); - cy.get('input[placeholder="Enter your zip code"]').should('have.value', "1234"); - //click on reservation button - cy.contains('Reserve').click(); - cy.contains("Check your email to confirm an order."); - - }) \ No newline at end of file diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js deleted file mode 100644 index 0e7290a..0000000 --- a/cypress/support/e2e.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/e2e.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands' - -// Alternatively you can use CommonJS syntax: -// require('./commands') \ No newline at end of file