text
stringlengths
3
1.39M
id
stringlengths
16
173
metadata
dict
__index_level_0__
int64
0
363
const el = document.getElementById('extension') if (el) { el.textContent = 'inserted from extension!' } // get the active tab // chrome.tabs.query({ active: true }, (tabs) => { // if (tabs && tabs.length) { // const tab = tabs[0] // // // example how to get all frames by their id (useful) // chrome.we...
cypress/system-tests/projects/plugin-extension/ext/background.js/0
{ "file_path": "cypress/system-tests/projects/plugin-extension/ext/background.js", "repo_id": "cypress", "token_count": 295 }
281
it('is true', () => {})
cypress/system-tests/projects/plugin-run-events/cypress/e2e/run_events_spec_1.cy.js/0
{ "file_path": "cypress/system-tests/projects/plugin-run-events/cypress/e2e/run_events_spec_1.cy.js", "repo_id": "cypress", "token_count": 10 }
282
const { defineConfig } = require("cypress"); const webpackConfig = require("./webpack.config.js"); module.exports = defineConfig({ component: { devServer: { framework: "vue", bundler: "webpack", webpackConfig, }, }, });
cypress/system-tests/projects/pristine-cjs-project/expected-cypress-js-component-vue.js-3-webpack/cypress.config.js/0
{ "file_path": "cypress/system-tests/projects/pristine-cjs-project/expected-cypress-js-component-vue.js-3-webpack/cypress.config.js", "repo_id": "cypress", "token_count": 98 }
283
{ "name": "misconfigured-cypress-ct-qwik", "version": "1.0.0", "main": "./index.js" }
cypress/system-tests/projects/qwik-app/misconfigured-cypress-ct-qwik/package.json/0
{ "file_path": "cypress/system-tests/projects/qwik-app/misconfigured-cypress-ct-qwik/package.json", "repo_id": "cypress", "token_count": 45 }
284
/* eslint-disable */ it('is true', () => { expect(true).to.be.true })
cypress/system-tests/projects/record/cypress/e2e/app.cy.js/0
{ "file_path": "cypress/system-tests/projects/record/cypress/e2e/app.cy.js", "repo_id": "cypress", "token_count": 31 }
285
const { defineConfig } = require('cypress') module.exports = defineConfig({ e2e: { experimentalRunAllSpecs: true, supportFile: false, specPattern: '**/*.cy.js', }, })
cypress/system-tests/projects/run-all-specs/cypress.config.js/0
{ "file_path": "cypress/system-tests/projects/run-all-specs/cypress.config.js", "repo_id": "cypress", "token_count": 70 }
286
{ "projectFixtureDirectory": "runner-specs" }
cypress/system-tests/projects/runner-e2e-specs/package.json/0
{ "file_path": "cypress/system-tests/projects/runner-e2e-specs/package.json", "repo_id": "cypress", "token_count": 17 }
287
/** * Used in cy-in-cy tests in @packages/app. */ let setupFn let validateFn before(() => { setupFn = cy.stub().as('runSetup') validateFn = cy.stub().as('runValidation') }) it('t1', () => { cy.session('user1', setupFn, { validate: validateFn, }) cy.log('after') }) it('t2', () => { cy.session('user...
cypress/system-tests/projects/session-and-origin-e2e-specs/cypress/e2e/session/restores_saved_session.cy.js/0
{ "file_path": "cypress/system-tests/projects/session-and-origin-e2e-specs/cypress/e2e/session/restores_saved_session.cy.js", "repo_id": "cypress", "token_count": 166 }
288
it('passes', () => { expect(1).to.equal(1) })
cypress/system-tests/projects/spec-name-special-characters/cypress/e2e/fixture&%.cy.js/0
{ "file_path": "cypress/system-tests/projects/spec-name-special-characters/cypress/e2e/fixture&%.cy.js", "repo_id": "cypress", "token_count": 23 }
289
import { saveStudio, verifyCommandLog } from './e2e' const isTextTerminal = Cypress.config('isTextTerminal') export const externalTest = () => { it('can write to an imported test', () => { Cypress.config('isTextTerminal', isTextTerminal) cy.visit('/index.html').then(() => { Cypress.emit('run:end') ...
cypress/system-tests/projects/studio/cypress/support/external.js/0
{ "file_path": "cypress/system-tests/projects/studio/cypress/support/external.js", "repo_id": "cypress", "token_count": 191 }
290
{ "name": "svelte-vite", "version": "0.0.0", "private": true, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.1", "svelte": "^3.44.0", "vite": "^3.0.0" }, "type": "module", "projectFixtureDirectory": "svelte" }
cypress/system-tests/projects/svelte-vite/package.json/0
{ "file_path": "cypress/system-tests/projects/svelte-vite/package.json", "repo_id": "cypress", "token_count": 129 }
291
module.exports = { 'e2e': { 'specPattern': 'cypress/e2e/*', 'supportFile': false, setupNodeEvents (on, config) { process.stderr.write('Plugin Loaded\n') process.stderr.write(`Plugin Node version: ${process.versions.node}\n`) process.stderr.write(`Plugin Electron version: ${process.versio...
cypress/system-tests/projects/system-node/cypress.config.js/0
{ "file_path": "cypress/system-tests/projects/system-node/cypress.config.js", "repo_id": "cypress", "token_count": 152 }
292
module.exports = { 'fixturesFolder': 'tests/_fixtures', 'port': 8888, 'projectId': 'abc123', 'component': { experimentalSingleTabRunMode: true, 'specPattern': 'src/**/*.spec.cy.js', 'supportFile': 'tests/_support/spec_helper.js', 'devServer': { 'framework': 'react', 'bundler': 'webpa...
cypress/system-tests/projects/todos/cypress.config.js/0
{ "file_path": "cypress/system-tests/projects/todos/cypress.config.js", "repo_id": "cypress", "token_count": 223 }
293
{ "name": "\u2665" }
cypress/system-tests/projects/todos/tests/_fixtures/unicode_escape.json/0
{ "file_path": "cypress/system-tests/projects/todos/tests/_fixtures/unicode_escape.json", "repo_id": "cypress", "token_count": 14 }
294
import { add } from './math' it('is true', () => { expect(add(1, 2)).to.eq(3) }) it('uses custom command', () => { // defined in support file cy.add(1, 2).then((result: number) => expect(result).to.eq(3)) })
cypress/system-tests/projects/ts-proj-custom-names/cypress/e2e/app.cy.ts/0
{ "file_path": "cypress/system-tests/projects/ts-proj-custom-names/cypress/e2e/app.cy.ts", "repo_id": "cypress", "token_count": 85 }
295
import { appName } from '@app/main' it('verifies path mapping', () => { // @ts-ignore expect(appName).to.equal('Best App Ever') })
cypress/system-tests/projects/ts-proj-with-paths/cypress/e2e/app.cy.ts/0
{ "file_path": "cypress/system-tests/projects/ts-proj-with-paths/cypress/e2e/app.cy.ts", "repo_id": "cypress", "token_count": 49 }
296
## v8-snapshot/deferred-from-healthy The goal of this project is to have a healthy dependency (healthy.js) that requires a deferred dependency (lib/deferred.js). First snapshot `entry.js`. You can then load up the app by running: ``` electron -r ./hook-require.js ./app.js ```
cypress/system-tests/projects/v8-snapshot/deferred-from-healthy/README.md/0
{ "file_path": "cypress/system-tests/projects/v8-snapshot/deferred-from-healthy/README.md", "repo_id": "cypress", "token_count": 86 }
297
// @ts-check 'use strict' const path = require('path') require('@packages/v8-snapshot-require').snapshotRequire(path.resolve(__dirname, '..'), { diagnosticsEnabled: true, useCache: true, })
cypress/system-tests/projects/v8-snapshot/example-express/app/hook-require.js/0
{ "file_path": "cypress/system-tests/projects/v8-snapshot/example-express/app/hook-require.js", "repo_id": "cypress", "token_count": 70 }
298
{ "name": "external-from-healthy" }
cypress/system-tests/projects/v8-snapshot/external-from-healthy/package.json/0
{ "file_path": "cypress/system-tests/projects/v8-snapshot/external-from-healthy/package.json", "repo_id": "cypress", "token_count": 16 }
299
'use strict' const assert = require('assert') function manipulateCache () { // deep-sync-deps depends on sync-deps, however that is already // fully initialized as parts of deep-sync-deps exports const sync1 = require('./lib/sync-deps.js') // We delete sync-deps from the module cache const syncDepsId = requ...
cypress/system-tests/projects/v8-snapshot/require-cache/dep-cached-manipulator.js/0
{ "file_path": "cypress/system-tests/projects/v8-snapshot/require-cache/dep-cached-manipulator.js", "repo_id": "cypress", "token_count": 370 }
300
function App () { return ( <h1>Hello World</h1> ) } export default App
cypress/system-tests/projects/vite-simple/src/App.jsx/0
{ "file_path": "cypress/system-tests/projects/vite-simple/src/App.jsx", "repo_id": "cypress", "token_count": 33 }
301
const CopyPlugin = require('copy-webpack-plugin') module.exports = { module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-react'], }, }, }, ],...
cypress/system-tests/projects/webpack-dev-server-relative/webpack.config.js/0
{ "file_path": "cypress/system-tests/projects/webpack-dev-server-relative/webpack.config.js", "repo_id": "cypress", "token_count": 247 }
302
module.exports = {}
cypress/system-tests/projects/webpack-dev-server/webpack.config.js/0
{ "file_path": "cypress/system-tests/projects/webpack-dev-server/webpack.config.js", "repo_id": "cypress", "token_count": 7 }
303
// Since we are linking the `@cypress/webpack-preprocessor` package, // `require('webpack')` will resolve the version found in our repo (v4). // We need to override the webpack require to point to the local node_modules const Module = require('module') const originalModuleLoad = Module._load Module._load = function (...
cypress/system-tests/projects/webpack-preprocessor-webpack-5/cypress.config.js/0
{ "file_path": "cypress/system-tests/projects/webpack-preprocessor-webpack-5/cypress.config.js", "repo_id": "cypress", "token_count": 663 }
304
it('is true', () => { // if this is served it will fail expect(true).to.be.false })
cypress/system-tests/projects/working-preprocessor/cypress/e2e/app.cy.js/0
{ "file_path": "cypress/system-tests/projects/working-preprocessor/cypress/e2e/app.cy.js", "repo_id": "cypress", "token_count": 32 }
305
const chokidar = require('chokidar') const path = require('path') const fs = require('fs-extra') const _ = require('lodash') const minimist = require('minimist') const toolingRoot = path.join(__dirname, '..') const PROJECT_FIXTURE_DIRECTORY = 'projects' const DIR_PATH = path.join(toolingRoot, PROJECT_FIXTURE_DIRECTO...
cypress/system-tests/scripts/scaffold.js/0
{ "file_path": "cypress/system-tests/scripts/scaffold.js", "repo_id": "cypress", "token_count": 1064 }
306
import systemTests from '../lib/system-tests' describe('component testing projects', function () { systemTests.setup() systemTests.it('create-react-app-custom-index-html', { project: 'create-react-app-custom-index-html', testingType: 'component', spec: 'src/App.cy.jsx', browser: 'chrome', expe...
cypress/system-tests/test/component_testing_index_html_spec.ts/0
{ "file_path": "cypress/system-tests/test/component_testing_index_html_spec.ts", "repo_id": "cypress", "token_count": 314 }
307
const systemTests = require('../lib/system-tests').default const { stripIndent } = require('common-tags') const bodyParser = require('body-parser') const onServer = function (app) { app.use(bodyParser.json({ extended: false })) app.get('/get-json', (req, res) => { return res.json([1, 2, 3]) }) app.get('/...
cypress/system-tests/test/fetch_polyfill_spec.js/0
{ "file_path": "cypress/system-tests/test/fetch_polyfill_spec.js", "repo_id": "cypress", "token_count": 2092 }
308
const systemTests = require('../lib/system-tests').default describe('e2e issue 5016 - screenshot times out after clicking target _blank', function () { systemTests.setup() // this test originally was scoped to !webkit, but Firefox has a (non-regression) flake // issue: https://github.com/cypress-io/cypress/issu...
cypress/system-tests/test/issue_5016_spec.js/0
{ "file_path": "cypress/system-tests/test/issue_5016_spec.js", "repo_id": "cypress", "token_count": 259 }
309
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....
cypress/system-tests/test/non_root_read_only_fs_spec.ts/0
{ "file_path": "cypress/system-tests/test/non_root_read_only_fs_spec.ts", "repo_id": "cypress", "token_count": 446 }
310
import systemTests from '../lib/system-tests' const it = systemTests.it describe('retries', () => { systemTests.setup() it('supports retries', { browser: '!chrome', project: 'retries-2', spec: 'fail-twice.cy.js', snapshot: true, }) // TODO: merge in above once --window-size is respected in h...
cypress/system-tests/test/retries_spec.ts/0
{ "file_path": "cypress/system-tests/test/retries_spec.ts", "repo_id": "cypress", "token_count": 343 }
311
import path from 'path' import systemTests from '../lib/system-tests' import Fixtures, { projectPath } from '../lib/fixtures' import { promises as fs } from 'fs' const snapshotFile = (project, file, folder = 'e2e') => { const filePath = path.join(projectPath(project), 'cypress', folder, file) return fs.readFile(f...
cypress/system-tests/test/studio_spec.ts/0
{ "file_path": "cypress/system-tests/test/studio_spec.ts", "repo_id": "cypress", "token_count": 879 }
312
import systemTests from '../lib/system-tests' import type { fixtureDirs } from '@tooling/system-tests' type ProjectDirs = typeof fixtureDirs const VITE_REACT: ProjectDirs[number][] = ['vite2.8.6-react', 'vite2.9.1-react', 'vite3.0.2-react', 'vite4.0.4-react', 'vite5.2.8-react'] describe('@cypress/vite-dev-server', ...
cypress/system-tests/test/vite_dev_server_fresh_spec.ts/0
{ "file_path": "cypress/system-tests/test/vite_dev_server_fresh_spec.ts", "repo_id": "cypress", "token_count": 477 }
313
import { config, VersionMeta } from './config' import { promises as fs } from 'fs' const { versionMetaPath } = config export class Metadata { constructor (readonly version: string) {} _read (): VersionMeta | null { try { return require(versionMetaPath) } catch (err) { // On first time running ...
cypress/tooling/electron-mksnapshot/src/metadata.ts/0
{ "file_path": "cypress/tooling/electron-mksnapshot/src/metadata.ts", "repo_id": "cypress", "token_count": 323 }
314
import { strict as assert } from 'assert' import type { Metafile } from 'esbuild' import type { CreateBundle } from './types' /** * Builds the bundle via esbuild with the sole purpose of extracting the metadata which esbuild produces aside from the * bundle. * This data can be used to reason about dependencies and ...
cypress/tooling/packherd/src/get-metadata.ts/0
{ "file_path": "cypress/tooling/packherd/src/get-metadata.ts", "repo_id": "cypress", "token_count": 315 }
315
import debug from 'debug' import { strict as assert } from 'assert' import { readFileSync } from 'fs' import path from 'path' import { execSync, ExecSyncOptions, StdioOptions } from 'child_process' import { BlueprintConfig, scriptFromBlueprint } from './blueprint' import type { CreateBundleOpts, CreateSnapshotScriptOpt...
cypress/tooling/v8-snapshot/src/generator/create-snapshot-script.ts/0
{ "file_path": "cypress/tooling/v8-snapshot/src/generator/create-snapshot-script.ts", "repo_id": "cypress", "token_count": 4507 }
316
import '@packages/server/v8-snapshot-entry'
cypress/tooling/v8-snapshot/src/setup/v8-snapshot-entry.ts/0
{ "file_path": "cypress/tooling/v8-snapshot/src/setup/v8-snapshot-entry.ts", "repo_id": "cypress", "token_count": 16 }
317
// Reproduces execa code using lib errname which needs to be deferred const errname = require('./lib/errname') module.exports = function getErrname(n) { return errname(n) }
cypress/tooling/v8-snapshot/test/fixtures/deep-nested-deferred/commit-info/execa/index.js/0
{ "file_path": "cypress/tooling/v8-snapshot/test/fixtures/deep-nested-deferred/commit-info/execa/index.js", "repo_id": "cypress", "token_count": 57 }
318
// This module delays calling a function that needs to be deferred and thus should not be deferred const isBuffer = require('./lateuses-static-deferred') module.exports = function areBuffer(x, y) { return isBuffer(x) && isBuffer(y) }
cypress/tooling/v8-snapshot/test/fixtures/load-static-deferred/uses-lateuses-static-deferred.js/0
{ "file_path": "cypress/tooling/v8-snapshot/test/fixtures/load-static-deferred/uses-lateuses-static-deferred.js", "repo_id": "cypress", "token_count": 67 }
319
let first, second first = second = require('./base') exports.first = first exports.second = second
cypress/tooling/v8-snapshot/test/fixtures/rewrites/multi-assign.js/0
{ "file_path": "cypress/tooling/v8-snapshot/test/fixtures/rewrites/multi-assign.js", "repo_id": "cypress", "token_count": 32 }
320