Files
dc/client/cypress.config.ts
T
dc aae48dc401
Build / Build-and-ng-test (pull_request) Failing after 1m36s
Build / Build-and-test-development (pull_request) Skipped
Lighthouse Checks / lighthouse (pull_request) Successful in 20m18s
test(e2e): scroll the grid so the NOTES column is on screen for the siphonophore beat
The three-row siphonophore result is narrower than the grid viewport, so
Handsontable sizes the columns wider than it (scrollWidth 1562 vs
clientWidth 1340): a horizontal scrollbar appears and NOTES - the column the
match is actually in - is clipped. The cell text is in the DOM either way, so
the beat passed without it, but the demo read as three arbitrary rows.

scrollGridTo() sets scrollLeft on #hotTable .wtHolder, asserts the value
landed, and the beat asserts the full NOTES text and scrolls back for the
following beats. It is a plain spec step - CI runs it, no recording flag and
no cy.wait.

Also lets a recording size the browser window: the capture is the window's
content area, so RECORD_WINDOW_SIZE is passed through as --window-size for a
real Chromium browser (Electron ignores it). That is what makes a 16:9 pane
possible: (W-450)/(H-96) = 16/9 at 1920x923 of content, i.e. 1920x1010 of
window, for a 1470x827 pane and the repo's 1600x900 viewport at ~0.90 zoom.

Inert unless the env var is set, so CI is unaffected. dc-cypress updated with
the window-sizing recipe, the clipped-column scroll and the frame
mean/variance scan used to find the cut point.
2026-09-16 18:44:25 +00:00

64 lines
2.0 KiB
TypeScript

import { defineConfig } from 'cypress'
export default defineConfig({
reporter: 'mochawesome',
reporterOptions: {
reportDir: 'cypress/results',
overwrite: false,
html: true,
json: false
},
viewportHeight: 900,
viewportWidth: 1600,
chromeWebSecurity: false,
defaultCommandTimeout: 30000,
env: {
hosturl: 'http://localhost:4200',
appLocation: '',
site_id_SAS9: '70221618',
site_id_SASVIYA: '70253615',
site_id_SASJS: '123',
serverType: 'SASJS',
libraryToOpenIncludes_SASVIYA: 'viya',
libraryToOpenIncludes_SAS9: 'dc',
libraryToOpenIncludes_SASJS: 'dc_jslib',
debug: false,
screenshotOnRunFailure: false,
longerCommandTimeout: 50000,
testLicenceUserLimits: false
},
e2e: {
video: true,
setupNodeEvents(on, config) {
// Pin the browser locale so locale-formatted cells (intl-date/time/datetime)
// render deterministically regardless of the runner's system locale.
on('before:browser:launch', (browser, launchOptions) => {
// Recording only: the video capture is the browser window, which
// contains the Cypress runner - the command log takes the left ~450px
// and the app sits in the remaining pane. Sizing the window is the
// only lever that moves the capture, and only for a real Chromium
// browser (Electron ignores it). For a 16:9 pane, solve
// (W - 450) / (H - 96) = 16/9: W = 1920 -> H = 923 of window content,
// so pass RECORD_WINDOW_SIZE=1920,1010 and crop the pane.
// Inert unless the env var is set, so CI is unaffected.
if (process.env.RECORD_WINDOW_SIZE && browser.family === 'chromium') {
launchOptions.args.push(
`--window-size=${process.env.RECORD_WINDOW_SIZE}`
)
}
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.args.push('--lang=en-GB')
}
return launchOptions
})
}
}
})