60e2149072
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.
93 lines
2.6 KiB
JavaScript
93 lines
2.6 KiB
JavaScript
"use strict";
|
|
|
|
const os = require('os');
|
|
const Promise = require('bluebird');
|
|
const Xvfb = require('@cypress/xvfb');
|
|
const {
|
|
stripIndent
|
|
} = require('common-tags');
|
|
const Debug = require('debug');
|
|
const {
|
|
throwFormErrorText,
|
|
errors
|
|
} = require('../errors');
|
|
const util = require('../util');
|
|
const debug = Debug('cypress:cli');
|
|
const debugXvfb = Debug('cypress:xvfb');
|
|
debug.Debug = debugXvfb.Debug = Debug;
|
|
const xvfbOptions = {
|
|
displayNum: process.env.XVFB_DISPLAY_NUM,
|
|
timeout: 30000,
|
|
// milliseconds
|
|
// need to explicitly define screen otherwise electron will crash
|
|
// https://github.com/cypress-io/cypress/issues/6184
|
|
xvfb_args: ['-screen', '0', '1280x1024x24'],
|
|
onStderrData(data) {
|
|
if (debugXvfb.enabled) {
|
|
debugXvfb(data.toString());
|
|
}
|
|
}
|
|
};
|
|
const xvfb = Promise.promisifyAll(new Xvfb(xvfbOptions));
|
|
module.exports = {
|
|
_debugXvfb: debugXvfb,
|
|
// expose for testing
|
|
|
|
_xvfb: xvfb,
|
|
// expose for testing
|
|
|
|
_xvfbOptions: xvfbOptions,
|
|
// expose for testing
|
|
|
|
start() {
|
|
debug('Starting Xvfb');
|
|
return xvfb.startAsync().return(null).catch({
|
|
nonZeroExitCode: true
|
|
}, throwFormErrorText(errors.nonZeroExitCodeXvfb)).catch(err => {
|
|
if (err.known) {
|
|
throw err;
|
|
}
|
|
return throwFormErrorText(errors.missingXvfb)(err);
|
|
});
|
|
},
|
|
stop() {
|
|
debug('Stopping Xvfb');
|
|
return xvfb.stopAsync().return(null).catch(() => {
|
|
// noop
|
|
});
|
|
},
|
|
isNeeded() {
|
|
if (process.env.ELECTRON_RUN_AS_NODE) {
|
|
debug('Environment variable ELECTRON_RUN_AS_NODE detected, xvfb is not needed');
|
|
return false; // xvfb required for electron processes only.
|
|
}
|
|
if (os.platform() !== 'linux') {
|
|
return false;
|
|
}
|
|
if (process.env.DISPLAY) {
|
|
const issueUrl = util.getGitHubIssueUrl(4034);
|
|
const message = stripIndent`
|
|
DISPLAY environment variable is set to ${process.env.DISPLAY} on Linux
|
|
Assuming this DISPLAY points at working X11 server,
|
|
Cypress will not spawn own Xvfb
|
|
|
|
NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
|
|
see ${issueUrl}
|
|
Solution: Unset the DISPLAY variable and try again:
|
|
DISPLAY= npx cypress run ...
|
|
`;
|
|
debug(message);
|
|
return false;
|
|
}
|
|
debug('undefined DISPLAY environment variable');
|
|
debug('Cypress will spawn its own Xvfb');
|
|
return true;
|
|
},
|
|
// async method, resolved with Boolean
|
|
verify() {
|
|
return xvfb.startAsync().return(true).catch(err => {
|
|
debug('Could not verify xvfb: %s', err.message);
|
|
return false;
|
|
}).finally(xvfb.stopAsync);
|
|
}
|
|
}; |