Skip to content

Commit c15d2bf

Browse files
committed
chore: update snapshots for Playwright
1 parent 9d7e3c5 commit c15d2bf

File tree

896 files changed

+24208
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

896 files changed

+24208
-48
lines changed

jsx-pinia-playwright/.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
test-results/
31+
playwright-report/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

jsx-pinia-playwright/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# jsx-pinia-playwright
2+
3+
This template should help get you started developing with Vue 3 in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8+
9+
## Customize configuration
10+
11+
See [Vite Configuration Reference](https://vitejs.dev/config/).
12+
13+
## Project Setup
14+
15+
```sh
16+
pnpm install
17+
```
18+
19+
### Compile and Hot-Reload for Development
20+
21+
```sh
22+
pnpm dev
23+
```
24+
25+
### Compile and Minify for Production
26+
27+
```sh
28+
pnpm build
29+
```
30+
31+
### Run End-to-End Tests with [Playwright](https://playwright.dev)
32+
33+
```sh
34+
# Install browsers for the first run
35+
npx playwright install
36+
37+
# Runs the end-to-end tests.
38+
pnpm test:e2e
39+
# Runs the tests only on Desktop Chrome.
40+
pnpm test:e2e -- --project="Desktop Chrome"
41+
# Runs the tests of a specific file.
42+
pnpm test:e2e -- tests/example.spec.ts
43+
# Runs the tests in debug mode.
44+
pnpm test:e2e -- --debug
45+
```

jsx-pinia-playwright/e2e/vue.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { test, expect } = require('@playwright/test');
2+
3+
// See here how to get started:
4+
// https://playwright.dev/docs/intro
5+
test('visits the app root url', async ({ page }) => {
6+
await page.goto('/');
7+
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
8+
})

jsx-pinia-playwright/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

jsx-pinia-playwright/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "jsx-pinia-playwright",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"dev": "vite",
6+
"build": "vite build",
7+
"preview": "vite preview --port 4173",
8+
"test:e2e": "playwright test"
9+
},
10+
"dependencies": {
11+
"pinia": "^2.0.21",
12+
"vue": "^3.2.38"
13+
},
14+
"devDependencies": {
15+
"@playwright/test": "^1.25.1",
16+
"@vitejs/plugin-vue": "^3.0.3",
17+
"@vitejs/plugin-vue-jsx": "^2.0.1",
18+
"vite": "^3.0.9"
19+
}
20+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// @ts-check
2+
const { devices } = require('@playwright/test')
3+
4+
/**
5+
* Read environment variables from file.
6+
* https://github.com/motdotla/dotenv
7+
*/
8+
// require('dotenv').config();
9+
10+
/**
11+
* @see https://playwright.dev/docs/test-configuration
12+
* @type {import('@playwright/test').PlaywrightTestConfig}
13+
*/
14+
const config = {
15+
testDir: './e2e',
16+
/* Maximum time one test can run for. */
17+
timeout: 30 * 1000,
18+
expect: {
19+
/**
20+
* Maximum time expect() should wait for the condition to be met.
21+
* For example in `await expect(locator).toHaveText();`
22+
*/
23+
timeout: 5000
24+
},
25+
/* Fail the build on CI if you accidentally left test.only in the source code. */
26+
forbidOnly: !!process.env.CI,
27+
/* Retry on CI only */
28+
retries: process.env.CI ? 2 : 0,
29+
/* Opt out of parallel tests on CI. */
30+
workers: process.env.CI ? 1 : undefined,
31+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
32+
reporter: 'html',
33+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
34+
use: {
35+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
36+
actionTimeout: 0,
37+
/* Base URL to use in actions like `await page.goto('/')`. */
38+
baseURL: 'http://localhost:5173',
39+
40+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
41+
trace: 'on-first-retry',
42+
43+
/* Only on CI systems run the tests headless */
44+
headless: !!process.env.CI
45+
},
46+
47+
/* Configure projects for major browsers */
48+
projects: [
49+
{
50+
name: 'chromium',
51+
use: {
52+
...devices['Desktop Chrome']
53+
}
54+
},
55+
{
56+
name: 'firefox',
57+
use: {
58+
...devices['Desktop Firefox']
59+
}
60+
},
61+
{
62+
name: 'webkit',
63+
use: {
64+
...devices['Desktop Safari']
65+
}
66+
}
67+
68+
/* Test against mobile viewports. */
69+
// {
70+
// name: 'Mobile Chrome',
71+
// use: {
72+
// ...devices['Pixel 5'],
73+
// },
74+
// },
75+
// {
76+
// name: 'Mobile Safari',
77+
// use: {
78+
// ...devices['iPhone 12'],
79+
// },
80+
// },
81+
82+
/* Test against branded browsers. */
83+
// {
84+
// name: 'Microsoft Edge',
85+
// use: {
86+
// channel: 'msedge',
87+
// },
88+
// },
89+
// {
90+
// name: 'Google Chrome',
91+
// use: {
92+
// channel: 'chrome',
93+
// },
94+
// },
95+
],
96+
97+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
98+
// outputDir: 'test-results/',
99+
100+
/* Run your local dev server before starting the tests */
101+
webServer: {
102+
command: 'npm run dev',
103+
port: 5173,
104+
reuseExistingServer: !process.env.CI
105+
}
106+
}
107+
108+
module.exports = config
4.19 KB
Binary file not shown.

jsx-pinia-playwright/src/App.vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<script setup>
2+
import HelloWorld from './components/HelloWorld.vue'
3+
import TheWelcome from './components/TheWelcome.vue'
4+
</script>
5+
6+
<template>
7+
<header>
8+
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
9+
10+
<div class="wrapper">
11+
<HelloWorld msg="You did it!" />
12+
</div>
13+
</header>
14+
15+
<main>
16+
<TheWelcome />
17+
</main>
18+
</template>
19+
20+
<style scoped>
21+
header {
22+
line-height: 1.5;
23+
}
24+
25+
.logo {
26+
display: block;
27+
margin: 0 auto 2rem;
28+
}
29+
30+
@media (min-width: 1024px) {
31+
header {
32+
display: flex;
33+
place-items: center;
34+
padding-right: calc(var(--section-gap) / 2);
35+
}
36+
37+
.logo {
38+
margin: 0 2rem 0 0;
39+
}
40+
41+
header .wrapper {
42+
display: flex;
43+
place-items: flex-start;
44+
flex-wrap: wrap;
45+
}
46+
}
47+
</style>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* color palette from <https://github.com/vuejs/theme> */
2+
:root {
3+
--vt-c-white: #ffffff;
4+
--vt-c-white-soft: #f8f8f8;
5+
--vt-c-white-mute: #f2f2f2;
6+
7+
--vt-c-black: #181818;
8+
--vt-c-black-soft: #222222;
9+
--vt-c-black-mute: #282828;
10+
11+
--vt-c-indigo: #2c3e50;
12+
13+
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14+
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15+
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16+
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17+
18+
--vt-c-text-light-1: var(--vt-c-indigo);
19+
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20+
--vt-c-text-dark-1: var(--vt-c-white);
21+
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22+
}
23+
24+
/* semantic color variables for this project */
25+
:root {
26+
--color-background: var(--vt-c-white);
27+
--color-background-soft: var(--vt-c-white-soft);
28+
--color-background-mute: var(--vt-c-white-mute);
29+
30+
--color-border: var(--vt-c-divider-light-2);
31+
--color-border-hover: var(--vt-c-divider-light-1);
32+
33+
--color-heading: var(--vt-c-text-light-1);
34+
--color-text: var(--vt-c-text-light-1);
35+
36+
--section-gap: 160px;
37+
}
38+
39+
@media (prefers-color-scheme: dark) {
40+
:root {
41+
--color-background: var(--vt-c-black);
42+
--color-background-soft: var(--vt-c-black-soft);
43+
--color-background-mute: var(--vt-c-black-mute);
44+
45+
--color-border: var(--vt-c-divider-dark-2);
46+
--color-border-hover: var(--vt-c-divider-dark-1);
47+
48+
--color-heading: var(--vt-c-text-dark-1);
49+
--color-text: var(--vt-c-text-dark-2);
50+
}
51+
}
52+
53+
*,
54+
*::before,
55+
*::after {
56+
box-sizing: border-box;
57+
margin: 0;
58+
position: relative;
59+
font-weight: normal;
60+
}
61+
62+
body {
63+
min-height: 100vh;
64+
color: var(--color-text);
65+
background: var(--color-background);
66+
transition: color 0.5s, background-color 0.5s;
67+
line-height: 1.6;
68+
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
69+
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
70+
font-size: 15px;
71+
text-rendering: optimizeLegibility;
72+
-webkit-font-smoothing: antialiased;
73+
-moz-osx-font-smoothing: grayscale;
74+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@import "./base.css";
2+
3+
#app {
4+
max-width: 1280px;
5+
margin: 0 auto;
6+
padding: 2rem;
7+
8+
font-weight: normal;
9+
}
10+
11+
a,
12+
.green {
13+
text-decoration: none;
14+
color: hsla(160, 100%, 37%, 1);
15+
transition: 0.4s;
16+
}
17+
18+
@media (hover: hover) {
19+
a:hover {
20+
background-color: hsla(160, 100%, 37%, 0.2);
21+
}
22+
}
23+
24+
@media (min-width: 1024px) {
25+
body {
26+
display: flex;
27+
place-items: center;
28+
}
29+
30+
#app {
31+
display: grid;
32+
grid-template-columns: 1fr 1fr;
33+
padding: 0 2rem;
34+
}
35+
}

0 commit comments

Comments
 (0)