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
+116
View File
@@ -0,0 +1,116 @@
.container {
max-width: 980px;
text-align: center;
margin: 20px auto;
}
h1 {
margin-bottom: 20px;
text-shadow: 0 0 1px rgba(120, 120, 120, 19);
}
#geocoding_form {
margin: 40px auto 60px;
}
#address {
border-radius: 3px;
}
.input-group {
margin-left: 4%;
}
.glyphicon {
font-size: 18px;
z-index: 20;
cursor: pointer;
}
.glyphicon-search{
position: relative;
right: 30px;
}
.current-location {
margin-top: 30px;
}
#save-location {
display: inline;
margin: 10px auto;
line-height: 1.4;
}
.current-location .glyphicon-star,
.current-location .glyphicon-star-empty {
display: inline-block;
margin-left: 10px;
font-size: 22px;
vertical-align: text-bottom;
}
.glyphicon-menu-right {
position: absolute;
top: 50%;
right: 10px;
margin-top: -9px;
}
.map-holder {
max-width: 500px;
height: 350px;
margin: 0 auto;
background-color: #FCFCFC;
position: relative;
border-radius: 2px;
}
.map-holder p {
position: absolute;
width: 84px;
height: 22px;
left: 50%;
top: 50%;
margin: -11px auto 0 -42px;
font-size: 20px;
color: #969FA8;
}
#map {
max-width: 500px;
height: 350px;
margin: 0 auto;
}
.list-group {
padding: 0 15px;
margin-top: 50px;
}
.list-group-item {
position: relative;
padding: 10px 20px;
}
a.list-group-item {
cursor: pointer;
}
a.list-group-item:hover {
background-color: #F7FBFF;
}
a.active-location {
background-color: #EEF6FF;
}
a.active-location:hover {
background-color: #EBF3FC;
}
a.list-group-item span.createdAt {
display: block;
color: #969FA8;
z-index: -1;
}
+47
View File
@@ -0,0 +1,47 @@
{
"viewports": [
{
"name": "phone",
"width": 320,
"height": 480
},
{
"name": "tablet_v",
"width": 568,
"height": 1024
},
{
"name": "tablet_h",
"width": 1024,
"height": 768
}
],
"scenarios": [
{
"label": "My Homepage",
"url": "index.html",
"hideSelectors": [],
"removeSelectors": [],
"selectors": [
"#main"
],
"readyEvent": "gmapResponded",
"delay": 100,
"misMatchThreshold" : 0,
"onBeforeScript": "onBefore.js",
"onReadyScript": "onReady.js"
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"resembleOutputOptions": {
"ignoreAntialiasing": true,
"usePreciseMatching": true
},
"debug": false
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

File diff suppressed because one or more lines are too long
+148
View File
@@ -0,0 +1,148 @@
const React = require('react');
const Search = require('./Search');
const Map = require('./Map');
const CurrentLocation = require('./CurrentLocation');
const LocationList = require('./LocationList');
const App = React.createClass({
getInitialState() {
// Extract the favorite locations from local storage
let favorites = [];
if (localStorage.favorites) {
favorites = JSON.parse(localStorage.favorites);
}
// Nobody would get mad if we center it on Paris by default
return {
favorites: favorites,
currentAddress: 'Paris, France',
mapCoordinates: {
lat: 48.856614,
lng: 2.3522219
}
};
},
toggleFavorite(address) {
if (this.isAddressInFavorites(address)) {
this.removeFromFavorites(address);
} else {
this.addToFavorites(address);
}
},
addToFavorites(address) {
const favorites = this.state.favorites;
favorites.push({
address: address,
timestamp: Date.now()
});
this.setState({
favorites: favorites
});
localStorage.favorites = JSON.stringify(favorites);
},
removeFromFavorites(address) {
const favorites = this.state.favorites;
let index = -1;
for (let i = 0; i < favorites.length; i++) {
if (favorites[i].address == address) {
index = i;
break;
}
}
// If it was found, remove it from the favorites array
if (index !== -1) {
favorites.splice(index, 1);
this.setState({
favorites: favorites
});
localStorage.favorites = JSON.stringify(favorites);
}
},
isAddressInFavorites(address) {
const favorites = this.state.favorites;
for (let i = 0; i < favorites.length; i++) {
if (favorites[i].address == address) {
return true;
}
}
return false;
},
searchForAddress(address) {
const self = this;
// We will use GMaps' geocode functionality,
// which is built on top of the Google Maps API
GMaps.geocode({
address: address,
callback: function (results, status) {
if (status !== 'OK') return;
const latlng = results[0].geometry.location;
self.setState({
currentAddress: results[0].formatted_address,
mapCoordinates: {
lat: latlng.lat(),
lng: latlng.lng()
}
});
setTimeout(function () {
console.log('gmapResponded');
}, 1000);
}
});
},
componentDidMount() {
const that = this;
setTimeout(function () {
that.searchForAddress('San Francisco');
}, 2000);
},
render() {
return (
<div>
<h1>Your Google Maps Locations</h1>
<Search onSearch={this.searchForAddress}/>
<Map lat={this.state.mapCoordinates.lat} lng={this.state.mapCoordinates.lng}/>
<CurrentLocation address={this.state.currentAddress}
favorite={this.isAddressInFavorites(this.state.currentAddress)}
onFavoriteToggle={this.toggleFavorite}/>
<LocationList locations={this.state.favorites} activeLocationAddress={this.state.currentAddress}
onClick={this.searchForAddress}/>
</div>
);
}
});
module.exports = App;
@@ -0,0 +1,26 @@
const React = require('react');
const CurrentLocation = React.createClass({
toggleFavorite() {
this.props.onFavoriteToggle(this.props.address);
},
render() {
let starClassName = 'glyphicon glyphicon-star-empty';
if (this.props.favorite) {
starClassName = 'glyphicon glyphicon-star';
}
return (
<div className="col-xs-12 col-md-6 col-md-offset-3 current-location">
<h4 id="save-location">{this.props.address}</h4>
<span className={starClassName} onClick={this.toggleFavorite} aria-hidden="true"></span>
</div>
);
}
});
module.exports = CurrentLocation;
@@ -0,0 +1,28 @@
const React = require('react');
const moment = require('moment');
const LocationItem = React.createClass({
handleClick () {
this.props.onClick(this.props.address);
},
render () {
let cn = 'list-group-item';
if (this.props.active) {
cn += ' active-location';
}
return (
<a className={cn} onClick={this.handleClick}>
{this.props.address}
<span className="createdAt">{ moment(this.props.timestamp).fromNow() }</span>
<span className="glyphicon glyphicon-menu-right"></span>
</a>
);
}
});
module.exports = LocationItem;
@@ -0,0 +1,33 @@
const React = require('react');
const LocationItem = require('./LocationItem');
const LocationList = React.createClass({
render() {
const self = this;
const locations = this.props.locations.map(function (l) {
const active = self.props.activeLocationAddress == l.address;
// Notice that we are passing the onClick callback of this
// LocationList to each LocationItem.
return <LocationItem address={l.address} timestamp={l.timestamp}
active={active} onClick={self.props.onClick}/>;
});
if (!locations.length) {
return null;
}
return (
<div className="list-group col-xs-12 col-md-6 col-md-offset-3">
<span className="list-group-item active">Saved Locations</span>
{locations}
</div>
);
}
});
module.exports = LocationList;
+50
View File
@@ -0,0 +1,50 @@
const React = require('react');
const Map = React.createClass({
componentDidMount() {
// Only componentDidMount is called when the component is first added to
// the page. This is why we are calling the following method manually.
// This makes sure that our map initialization code is run the first time.
this.componentDidUpdate();
},
componentDidUpdate() {
if (this.lastLat == this.props.lat && this.lastLng == this.props.lng) {
// The map has already been initialized at this address.
// Return from this method so that we don't reinitialize it
// (and cause it to flicker).
return;
}
this.lastLat = this.props.lat;
this.lastLng = this.props.lng;
const map = new GMaps({
el: '#map',
lat: this.props.lat,
lng: this.props.lng
});
// Adding a marker to the location we are showing
map.addMarker({
lat: this.props.lat,
lng: this.props.lng
});
},
render() {
return (
<div className="map-holder">
<p>Loading...</p>
<div id="map"></div>
</div>
);
}
});
module.exports = Map;
+43
View File
@@ -0,0 +1,43 @@
const React = require('react');
const Search = React.createClass({
getInitialState() {
return {value: ''};
},
handleChange(event) {
this.setState({value: event.target.value});
},
handleSubmit(event) {
event.preventDefault();
// When the form is submitted, call the onSearch callback that is passed to the component
this.props.onSearch(this.state.value);
// Unfocus the text input field
this.getDOMNode().querySelector('input').blur();
},
render() {
return (
<form id="geocoding_form" className="form-horizontal" onSubmit={this.handleSubmit}>
<div className="form-group">
<div className="col-xs-12 col-md-6 col-md-offset-3">
<div className="input-group">
<input type="text" className="form-control" id="address" placeholder="Find a location..."
value={this.state.value} onChange={this.handleChange}/>
<span className="input-group-btn">
<span className="glyphicon glyphicon-search" aria-hidden="true"></span>
</span>
</div>
</div>
</div>
</form>
);
}
});
module.exports = Search;
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Your First Webapp With React</title>
<link href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.4/flatly/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="assets/css/styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="main" class="container">
<!-- The App will be rendered here -->
</div>
<!-- Including the Google Maps API and the GMaps library -->
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gmaps.js/0.4.12/gmaps.min.js"></script>
<!-- Our compiled JavaScript source file -->
<script src="./compiled.js"></script>
</body>
</html>
+7
View File
@@ -0,0 +1,7 @@
const React = require('react');
const App = require('./components/App');
React.render(
<App />,
document.getElementById('main')
);
+25
View File
@@ -0,0 +1,25 @@
{
"name": "first-webapp-react",
"version": "1.0.0",
"description": "",
"main": "main.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev-backstop-test": "node ../../cli/index.js test",
"watch": "watchify -v -d -t [ reactify --es6 ] main.js -o compiled.js",
"build": "NODE_ENV=production browserify -t [ reactify --es6 ] main.js | uglifyjs > compiled.js && backstop test"
},
"author": "Tutorialzine",
"license": "MIT",
"dependencies": {
"moment": "^2.10.2",
"react": "^0.14.0"
},
"devDependencies": {
"browserify": "^9.0.8",
"reactify": "^1.1.0",
"uglify-js": "^2.4.20",
"watchify": "^3.1.2"
}
}
+23
View File
@@ -0,0 +1,23 @@
**This simple project was originally found here...**
http://tutorialzine.com/2015/04/first-webapp-react/
Install:
make sure you are in the `simpleReactApp` directory and then...
`npm install`
then Build...
`npm run build`
Then open index.html in your browser.
**Note:** ignore antialiasing is used here.
See backstop.json: `"resembleOutputOptions": {"ignoreAntialiasing": true}`
---
**A BackstopJS test configuration file has already been added to this project.**
To test, simply run the build command above, and Backstop will open the html report in `./backstop_data/html_report`.
You can also run `npm run dev-backstop-test`, if you have run `npm install` at the root directory of the BackstopJS directory.