Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync attachments to assets directory #285

Merged
merged 9 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@cypress/webpack-preprocessor": "6.0.1",
"@cypress/xpath": "2.0.3",
"@saucelabs/cypress-junit-plugin": "0.2.0",
"@saucelabs/cypress-plugin": "3.1.3",
"@saucelabs/cypress-plugin": "3.2.1",
"@shelex/cypress-allure-plugin": "2.40.1",
"@tsconfig/node20": "20.1.2",
"babel-loader": "9.1.3",
Expand Down
12 changes: 10 additions & 2 deletions src/cypress-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}

// Configure reporters
function configureReporters(runCfg: RunConfig, opts: any) {

Check warning on line 63 in src/cypress-runner.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
const reporterConfig = {
reporterEnabled: `spec`,
};
Expand Down Expand Up @@ -118,6 +118,10 @@

process.env.CYPRESS_SAUCE_SUITE_NAME = suite.name;
process.env.CYPRESS_SAUCE_ARTIFACTS_DIRECTORY = runCfg.resultsDir;
process.env.SAUCE_WEB_ASSETS_DIR =
suite.config?.env?.SAUCE_SYNC_WEB_ASSETS?.toLowerCase() === 'true'
? runCfg.resultsDir
: '';

for (const [key, value] of Object.entries(envVars)) {
process.env[key] = value as string;
Expand Down Expand Up @@ -148,6 +152,10 @@
}

const testingType = suite.config.testingType || 'e2e';
const cypressOutputDir =
suite.config?.env?.SAUCE_SYNC_WEB_ASSETS?.toLowerCase() === 'true'
? undefined
: runCfg.resultsDir;

let opts: Partial<CypressCommandLine.CypressRunOptions> = {
project: path.dirname(cypressCfgFile),
Expand All @@ -161,8 +169,8 @@
specPattern: suite.config.specPattern,
excludeSpecPattern: suite.config.excludeSpecPattern || [],
},
videosFolder: runCfg.resultsDir,
screenshotsFolder: runCfg.resultsDir,
videosFolder: cypressOutputDir,
screenshotsFolder: cypressOutputDir,
video: shouldRecordVideo(),
videoCompression: false,
env: getEnv(suite),
Expand Down Expand Up @@ -296,7 +304,7 @@

// For dev and test purposes, this allows us to run our Cypress Runner from command line
if (require.main === module) {
const packageInfo = require(path.join(__dirname, '..', 'package.json'));

Check warning on line 307 in src/cypress-runner.ts

View workflow job for this annotation

GitHub Actions / test

Require statement not part of import statement
console.log(`Sauce Cypress Runner ${packageInfo.version}`);
console.log(`Running Cypress ${packageInfo.dependencies?.cypress || ''}`);

Expand Down
Loading