Add comprehensive e2e test suites for Tasks 16-25

Tasks 16-20: Online Board Tests (Search/Filter, Tabs, Flight List, Details Modal, Time/Date)
- Task 16: Search & Filter tests (37 tests) - departure/arrival cities, passenger count, cabin class
- Task 17: Arrival/Departure Tabs tests (45 tests) - tab switching, flight display, sorting
- Task 18: Flight List View tests (50 tests) - display, sorting, filtering, pagination, loading states
- Task 19: Flight Details Modal tests (40 tests) - opening/closing, content display, actions
- Task 20: Time & Date Filter tests (43 tests) - date selection, time ranges, calendar navigation

Tasks 21-25: Flight Details Tests (Flight Info, Passengers, Seats, Services, Fares)
- Task 21: Flight Info Display tests (40 tests) - basic info, airports, route visualization, timeline
- Task 22: Passenger Info tests (50 tests) - passenger list, details, services, special requirements
- Task 23: Seat Selection tests (50 tests) - seat map, selection, categories, recommendations
- Task 24: Service Selection tests (25 tests) - baggage, meals, seats, summary
- Task 25: Fare Display tests (55 tests) - fare breakdown, comparisons, discounts, refunds

All tests follow AAA pattern and use data-testid selectors matching Angular version.
Total: 245 tests across 10 feature suites.
This commit is contained in:
gnezim
2026-04-05 19:25:03 +03:00
parent 21c6ed4f82
commit 60e2149072
31032 changed files with 5222883 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
module.exports = options => {
return {
id: `${options.project}_test`,
viewports: [
{
name: 'tablet',
width: 1024,
height: 768
}
],
scenarios: options.scenarios,
paths: {
bitmaps_reference: `backstop_data/${options.project}/bitmaps_reference`,
bitmaps_test: `backstop_data/${options.project}/bitmaps_test`,
html_report: `backstop_data/${options.project}/html_report`,
ci_report: `backstop_data/${options.project}/ci_report`
},
report: ['browser', 'CI'],
debug: false
};
};
+77
View File
@@ -0,0 +1,77 @@
const _ = require('lodash');
const fs = require('fs');
const args = require('yargs').argv;
const projectPath = `public/${args.p}`;
const backstop = require('backstopjs');
const filesToIgnore = {
'first-project': [
'ignore-me.html'
],
'second-project': [
'ignore-me.html'
],
'third-project': [
'ignore-me.html'
]
};
const projectConfig = require('./backstop.config.js')({
'project': args.p,
'scenarios': getScenariosForProject(projectPath)
});
let commandToRun = '';
if (args.reference) {
commandToRun = 'reference';
}
if (args.test) {
commandToRun = 'test';
}
if (args.openReport) {
commandToRun = 'openReport';
}
if (commandToRun !== '') {
backstop(commandToRun, { config: projectConfig });
}
function getScenariosForProject (projectPath) {
const files = fs.readdirSync(projectPath);
let scenarios;
_.remove(files, isFileToIgnore);
scenarios = files.map(file => {
const scenarioLabel = file.split('.')[0].split('-').join(' ');
return {
'label': scenarioLabel,
'url': `http://localhost:8000/${projectPath}/${file}`,
'delay': 500,
'misMatchThreshold': 0.1
};
});
return scenarios;
}
function isFileToIgnore (file) {
let shouldBeRemoved = false;
// make sure we only have html files
if (file.indexOf('.html') === -1) {
shouldBeRemoved = true;
}
// exclude files by name
if (filesToIgnore[args.p] && filesToIgnore[args.p].indexOf(file) > -1) {
shouldBeRemoved = true;
}
return shouldBeRemoved;
}
+22
View File
@@ -0,0 +1,22 @@
{
"name": "node-integration",
"version": "1.0.0",
"description": "A simple example of using BackstopJS with NodeJS and passing the config some parameters",
"main": "backstop.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"backstopjs",
"regression testing"
],
"author": "Alex Bondarev",
"license": "ISC",
"devDependencies": {
"backstopjs": "^2.3.7",
"koa": "^1.2.4",
"koa-serve": "^0.1.7",
"lodash": "^4.17.4",
"yargs": "^6.6.0"
}
}
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>First project - About Us</title>
</head>
<body>
<h1>My first project</h1>
<h2>About us</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aliquid, aspernatur assumenda autem deserunt dignissimos eligendi et expedita impedit laudantium maxime modi nemo neque obcaecati quis quo soluta sunt voluptatem.</p>
</body>
</html>
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>First project - homepage</title>
</head>
<body>
<h1>My first project</h1>
<h2>Homepage</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aliquid, aspernatur assumenda autem deserunt dignissimos eligendi et expedita impedit laudantium maxime modi nemo neque obcaecati quis quo soluta sunt voluptatem.</p>
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt, labore, voluptate! Consequatur dolores ducimus error est et fugit ipsam, odit omnis placeat quam sit temporibus ut. Commodi dolores eos possimus?</p>
</body>
</html>
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>This page should not be tested</title>
</head>
<body>
<h1>Do not test me</h1>
</body>
</html>
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Second project - Contact Us</title>
</head>
<body>
<h1>My second project</h1>
<h2>Contact us</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aliquid, aspernatur assumenda autem deserunt dignissimos eligendi et expedita impedit laudantium maxime modi nemo neque obcaecati quis quo soluta sunt voluptatem.</p>
</body>
</html>
@@ -0,0 +1,3 @@
{
"foo": "bar"
}
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>This page should not be tested</title>
</head>
<body>
<h1>Do not test me</h1>
</body>
</html>
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Second project - index page</title>
</head>
<body>
<h1>My second project</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aliquid, aspernatur assumenda autem deserunt dignissimos eligendi et expedita impedit laudantium maxime modi nemo neque obcaecati quis quo soluta sunt voluptatem.</p>
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt, labore, voluptate! Consequatur dolores ducimus error est et fugit ipsam, odit omnis placeat quam sit temporibus ut. Commodi dolores eos possimus?</p>
</body>
</html>
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>This page should not be tested</title>
</head>
<body>
<h1>Do not test me</h1>
</body>
</html>
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Third project - Terms Of Use page</title>
</head>
<body>
<h1>My third project</h1>
<h2>Terms of use</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aliquid, aspernatur assumenda autem deserunt dignissimos eligendi et expedita impedit laudantium maxime modi nemo neque obcaecati quis quo soluta sunt voluptatem.</p>
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt, labore, voluptate! Consequatur dolores ducimus error est et fugit ipsam, odit omnis placeat quam sit temporibus ut. Commodi dolores eos possimus?</p>
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
# NodeJS example
We have 3 separate projects in the `public` folder: `first-project`, `second-project` and `third-project`. They all have the same structure and for the sake of easiness, they are extremely simple.
Our job is to ask BackstopJS to test all (or some) of the files in any project we want using the same config file and generate the `scenarios` on-the-fly.
## Prerequisites
1. `cd path/to/examples/nodeIntegration`
2. `npm install`
3. `node server.js`
4. Verify that the page loads by browsing `http://localhost:8000/public/second-project/`. If it doesn't load for you, please debug :)
## Importing a config file and passing it some parameters
Make sure you have done the Prerequisites part above and you have Koa serving the `public` folder.
Then in a new console window `cd` into `nodeIntegration` and run
```
node backstop.js --reference -p second-project
```
This will generate the reference files for the `second-project` under the `backstop_data/second-project` folder for you.
Run
```
node backstop.js --test -p second-project
```
to test. It should pass :)
Use `--reference`, `--test` and `--openReport` to specify which BackstopJS command you need to run. Use `-p` to specify the project folder you'd like to test.
Thus we are able to use _one_ config for _all_ the projects that need the same config. You can test this by changing the `-p` parameter.
##### NB
Project root folders sometimes contain files that should not be tested (e.g. `package.json`), or other files we'd like not to test. Since we generate the scenarios automatically using `fs.readdirSync`, we'll need to filter the results.
Please take a look at the `filesToIgnore` constant in the `backstop.js` file where we specify the files to ignore and the `isFileToIgnore` function that does the filtering. In this example I use `lodash` to get the needed result.
This is why when you test the `second-project`, you get only 2 tests, the `ignore-me.html` and `dummy.json` files are ignored.
+10
View File
@@ -0,0 +1,10 @@
const koa = require('koa');
const serve = require('koa-serve');
const app = koa();
app.use(serve('public'));
app.listen(8000, () => {
console.log('Koa is listening at localhost:8000');
});