These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.
Before you begin, ensure you have met the following requirements:
- Node.js installed on your local machine.
- npm (Node Package Manager) installed. npm typically comes bundled with Node.js.
- Clone the repository to your local machine: git clone https://github.com/Tesena-smart-testing/MobileAutomatizationBooking.git
- Open your terminal and navigate to the project directory: cd
<project-directory>
- Install the project dependencies using npm: npm install
- Install WebDriverIO globally (if not already installed):npm install -g webdriverio
- Install Android Studio if you haven't already. You can download it from the official website.
- Add Babel: npm install --save-dev @babel/core @babel/cli @babel/preset-env @babel/register Babel setup:https://webdriver.io/docs/babel
Before you can start using the Allure reporter, you need to install the necessary dependencies. You can do this using npm:
npm install @wdio/allure-reporter --save-dev npm install allure-commandline
Once you have the required packages installed, you need to configure your test framework to use the Allure reporter. This example shows how to configure it with WebDriverIO:
// In your WebDriverIO configuration file (e.g., wdio.conf.js)
const { join } = require('path');
exports.config = { // Other WebDriverIO configuration settings...
reporters: ['spec', ['allure', { outputDir: 'allure-results', disableWebdriverStepsReporting: false, disableWebdriverScreenshotsReporting: false, }]], };
After configuring your test framework, you can generate and view Allure reports. Here are the steps to do so:
-
Run your tests.
-
Generate Allure report:
npx allure generate allure-results && npx allure open
It's essential to clean the contents of the allure-results
folder before generating a new report to prevent any conflicting data. You can do this by adding the --clean
flag to the allure generate
command:
npx allure generate --clean allure-results && npx allure open
To run the project, follow these steps:
-
Open your terminal and navigate to the project directory if you haven't already: cd
<project-directory>
-
Execute the following command to run the project using WebDriverIO: npx wdio run ./wdio.conf.js
This command will execute your project's WebDriverIO configuration file (
wdio.conf.js
) and run your automated tests.Commands:
npx wdio run ./wdio.conf.js
npx allure generate --clean allure-results && npx allure open
If you want to run a separated spec file, use this command:
npx wdio wdio.conf.js --spec ./tests/specs/app.hotel.spec.js