Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
totegamma committed Aug 25, 2024
1 parent a64166e commit f9e1080
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,30 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
browser:
- chromium
- firefox
- webkit
- 'mobile_chrome'
- 'mobile_safari'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install dependencies
run: npm install -g pnpm && pnpm install

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}

- name: Run Playwright tests
run: pnpm exec playwright test
run: pnpm exec playwright test --project=${{ matrix.browser }}

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ export default defineConfig({

/* Test against mobile viewports. */
{
name: 'Mobile Chrome',
name: 'mobile_chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'Mobile Safari',
name: 'mobile_safari',
use: { ...devices['iPhone 12'] },
},

Expand Down
9 changes: 3 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,16 @@ function App(): JSX.Element {
</Box>
</Box>
<Box
id="emblem"
sx={{
position: 'fixed',
zIndex: '-1',
opacity: { xs: '0.2', sm: '0.1' },
opacity: { xs: '0', sm: '0.1', md: '0.1' },
left: '-30px',
bottom: '-30px',
width: '300px',
height: '300px',
display: {
xs: 'none',
sm: 'block',
md: 'block'
}
display: 'block'
}}
>
<ConcrntLogo size="300px" color={theme.palette.background.contrastText} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/theming/ConcurrentWordmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function ConcurrentWordmark(props: ConcurrentWordmarkProps): JSX.Element
justifyContent: 'center'
}}
>
<Box>
<Box id="emblem">
<ConcrntLogo size="32px" color={props.color} />
</Box>
<Typography
Expand Down
21 changes: 10 additions & 11 deletions tests/smoketest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ const guestTests = [
guestTests.forEach((t) => {
test(`smoke-guest-${t.name}`, async ({ page }) => {
await page.goto(`http://localhost:5173${t.path}`);
await page.waitForLoadState('networkidle');
const errorButton = page.getByRole('button', { name: 'とりあえずリロード' })
await expect(errorButton).toHaveCount(0);
const emblem = page.locator('#emblem').first();
await expect(emblem).toBeVisible();
});
})

Expand All @@ -47,11 +46,11 @@ const loggedinTests = [
{name: 'settings-importexport-migrate', path: '/settings/importexport/migrate'},
{name: 'settings-job', path: '/settings/job'},
{name: 'subscriptions', path: '/subscriptions'},
{name: 'timeline', path: '/timeline/tar69vv26r5s4wk0r067v20bvyw@ariake.concrnt.net'},
{name: 'profile by ccid', path: '/con1t0tey8uxhkqkd4wcp4hd4jedt7f0vfhk29xdd2'},
{name: 'profile by handle', path: '/tote.gammalab.net'},
{name: 'content by ccid', path: '/con1t0tey8uxhkqkd4wcp4hd4jedt7f0vfhk29xdd2/m6mzjwdcvexhbt52q068rhdatj8'},
{name: 'content by handle', path: '/tote.gammalab.net/m6mzjwdcvexhbt52q068rhdatj8'},
{name: 'timeline', path: '/timeline/tcjkcx7t5jdf3v5s6067yxcgpmm@zyouya.concrnt.net'},
{name: 'profile by ccid', path: '/con1jhvwl4mf6mjwz27duu39fe0fqcfu8lhd05k9vg'},
{name: 'profile by handle', path: '/e2etest.concrnt.world'},
{name: 'content by ccid', path: '/con1jhvwl4mf6mjwz27duu39fe0fqcfu8lhd05k9vg/m1ke6xs34dfgxcht1068rk43338'},
{name: 'content by handle', path: '/e2etest.concrnt.world/m1ke6xs34dfgxcht1068rk43338'},
]

loggedinTests.forEach((t) => {
Expand All @@ -61,12 +60,12 @@ loggedinTests.forEach((t) => {
// board aunt arm cushion install lyrics provide giraffe subway cart again arrow
localStorage.setItem('PrivateKey', '"02b03c01d6fa12f23980dcb9bb61eb4c022f406515cbe8cab9527dc8c15430fd"');
localStorage.setItem('Domain', '"zyouya.concrnt.net"');
localStorage.setItem('preference', '{"themeName":"blue","storageProvider":"domain","imgurClientID":"","s3Config":{"endpoint":"","accessKeyId":"","bucketName":"","publicUrl":"","secretAccessKey":"","forcePathStyle":false},"devMode":false,"showEditorOnTop":true,"showEditorOnTopMobile":false,"lists":{"snksm5vw9mat00yq7068rk5jz2m":{"pinned":true,"expanded":false,"defaultPostHome":true,"defaultPostStreams":["tcjkcx7t5jdf3v5s6067yxcgpmm@zyouya.concrnt.net"]}},"emojiPackages":["https://gist.githubusercontent.com/totegamma/6e1a047f54960f6bb7b946064664d793/raw/twemoji.json"],"sound":{"post":"/src/resources/Bubble.wav","notification":"/src/resources/Notification.wav","volume":50},"customThemes":{},"hideDisabledSubKey":false,"enableConcord":false}');
});

await page.goto(`http://localhost:5173${t.path}`);
await page.waitForLoadState('networkidle');
const errorButton = page.getByRole('button', { name: 'とりあえずリロード' })
await expect(errorButton).toHaveCount(0);
const emblem = page.locator('#emblem').first();
await expect(emblem).toBeVisible();
});
})

0 comments on commit f9e1080

Please sign in to comment.