Files
cypress/system-tests/test/non_root_read_only_fs_spec.ts
T
Bill Glesias 9580dc2e35 breaking: default video configuration option to false (#27008)
* chore: update darwin v8 snapshot

* BREAKING CHANGE: set video to false by default (system tests need updating).

* Update cli/CHANGELOG.md

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* chore: update type comments

* chore: update protocol snapshot

* run ci

* run ci

* set video to true for chrome browser crash test

* chore: put in workaround for failing system test spec to be fixed in 27062

* chore: allow retries on actionability tests to be at least one retry as the CI tests run faster without video on

* chore: fix flaky navigation test where done is called multiple times almsot always, but sometimes throws an error

---------

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2023-06-20 13:21:39 -04:00

47 lines
1.1 KiB
TypeScript

import * as fs from 'fs'
import * as path from 'path'
import systemTests from '../lib/system-tests'
import Fixtures from '../lib/fixtures'
import { scaffoldCommonNodeModules } from '@tooling/system-tests/lib/dep-installer'
describe('e2e readonly fs', function () {
systemTests.setup()
const projectPath = Fixtures.projectPath('read-only-project-root')
/**
* Change permissions recursively
*/
const chmodr = (p: string, mode: number) => {
const stats = fs.statSync(p)
fs.chmodSync(p, mode)
if (stats.isDirectory()) {
fs.readdirSync(p).forEach((child) => {
chmodr(path.join(p, child), mode)
})
}
}
const onRun = async (exec) => {
try {
await Fixtures.scaffoldProject('read-only-project-root')
await scaffoldCommonNodeModules()
chmodr(projectPath, 0o500)
await exec()
} finally {
chmodr(projectPath, 0o777)
}
}
systemTests.it('warns when unable to write to disk', {
project: 'read-only-project-root',
expectedExitCode: 1,
spec: 'spec.cy.js',
snapshot: true,
skipScaffold: true,
onRun,
})
})