e2eUtils.ts — vue Source File
Architecture documentation for e2eUtils.ts, a typescript file in the vue codebase. 2 imports, 8 dependents.
Entity Profile
Dependency Diagram
graph LR 74c9703b_0a18_7462_9820_16ae2926fb68["e2eUtils.ts"] 1d29bf33_f532_e958_df1c_3bd911068a94["path"] 74c9703b_0a18_7462_9820_16ae2926fb68 --> 1d29bf33_f532_e958_df1c_3bd911068a94 24a0b97f_9f2f_05f2_87f1_ecdd12ba42d4["puppeteer"] 74c9703b_0a18_7462_9820_16ae2926fb68 --> 24a0b97f_9f2f_05f2_87f1_ecdd12ba42d4 f404b13d_c38a_c8a5_cd72_754effa27b01["async-edge-cases.spec.ts"] f404b13d_c38a_c8a5_cd72_754effa27b01 --> 74c9703b_0a18_7462_9820_16ae2926fb68 fe555ea1_8700_26a1_1204_1bc65e2d33ef["basic-ssr.spec.ts"] fe555ea1_8700_26a1_1204_1bc65e2d33ef --> 74c9703b_0a18_7462_9820_16ae2926fb68 8b169d2b_d8bf_df75_5eb8_783abe859c91["commits.spec.ts"] 8b169d2b_d8bf_df75_5eb8_783abe859c91 --> 74c9703b_0a18_7462_9820_16ae2926fb68 c430f7de_c708_06ad_19ba_93d55b0f2f72["grid.spec.ts"] c430f7de_c708_06ad_19ba_93d55b0f2f72 --> 74c9703b_0a18_7462_9820_16ae2926fb68 afaca4bf_09df_8b93_a48b_cbfeee2f6a0c["markdown.spec.ts"] afaca4bf_09df_8b93_a48b_cbfeee2f6a0c --> 74c9703b_0a18_7462_9820_16ae2926fb68 a2eacfa0_6531_3300_dcd1_a86184018e56["svg.spec.ts"] a2eacfa0_6531_3300_dcd1_a86184018e56 --> 74c9703b_0a18_7462_9820_16ae2926fb68 7c9942dc_0c45_82d9_6c70_9eccab89ecf4["todomvc.spec.ts"] 7c9942dc_0c45_82d9_6c70_9eccab89ecf4 --> 74c9703b_0a18_7462_9820_16ae2926fb68 57dbc52e_b622_bee4_f013_5cb00f7494f9["tree.spec.ts"] 57dbc52e_b622_bee4_f013_5cb00f7494f9 --> 74c9703b_0a18_7462_9820_16ae2926fb68 style 74c9703b_0a18_7462_9820_16ae2926fb68 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import path from 'path'
import puppeteer from 'puppeteer'
export function getExampleUrl(
name: string,
apiType: 'classic' | 'composition'
) {
const file = apiType === 'composition' ? `${name}.html` : `${name}/index.html`
return `file://${path.resolve(
__dirname,
`../../examples/${apiType}/${file}`
)}`
}
export const E2E_TIMEOUT = 30 * 1000
const puppeteerOptions = process.env.CI
? { args: ['--no-sandbox', '--disable-setuid-sandbox'] }
: { headless: !process.env.DEBUG }
const maxTries = 30
export const timeout = (n: number) => new Promise(r => setTimeout(r, n))
export async function expectByPolling(
poll: () => Promise<any>,
expected: string
) {
for (let tries = 0; tries < maxTries; tries++) {
const actual = (await poll()) || ''
if (actual.indexOf(expected) > -1 || tries === maxTries - 1) {
expect(actual).toMatch(expected)
break
} else {
await timeout(50)
}
}
}
export function setupPuppeteer() {
let browser: puppeteer.Browser
let page: puppeteer.Page
beforeAll(async () => {
browser = await puppeteer.launch(puppeteerOptions)
})
beforeEach(async () => {
page = await browser.newPage()
await page.evaluateOnNewDocument(() => {
localStorage.clear()
})
page.on('console', e => {
if (e.type() === 'error') {
const err = e.args()[0]
console.error(
`Error from Puppeteer-loaded page:\n`,
err._remoteObject.description
)
// ... (128 more lines)
Domain
Subdomains
Dependencies
- path
- puppeteer
Imported By
Source
Frequently Asked Questions
What does e2eUtils.ts do?
e2eUtils.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, StyleProcessor subdomain.
What functions are defined in e2eUtils.ts?
e2eUtils.ts defines 4 function(s): expectByPolling, getExampleUrl, setupPuppeteer, timeout.
What does e2eUtils.ts depend on?
e2eUtils.ts imports 2 module(s): path, puppeteer.
What files import e2eUtils.ts?
e2eUtils.ts is imported by 8 file(s): async-edge-cases.spec.ts, basic-ssr.spec.ts, commits.spec.ts, grid.spec.ts, markdown.spec.ts, svg.spec.ts, todomvc.spec.ts, tree.spec.ts.
Where is e2eUtils.ts in the architecture?
e2eUtils.ts is located at test/e2e/e2eUtils.ts (domain: CompilerSFC, subdomain: StyleProcessor, directory: test/e2e).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free