Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
8d6f06f3
Commit
8d6f06f3
authored
Dec 14, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile nav tests
parent
3f7fae24
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
1 deletion
+69
-1
auth.ts
playwright/fixtures/auth.ts
+5
-0
Burger.pw.tsx
ui/snippets/header/Burger.pw.tsx
+61
-0
Burger.tsx
ui/snippets/header/Burger.tsx
+1
-0
Burger.pw.tsx_default_auth-base-view-1.png
..._screenshots__/Burger.pw.tsx_default_auth-base-view-1.png
+0
-0
Burger.pw.tsx_default_base-view-1.png
...der/__screenshots__/Burger.pw.tsx_default_base-view-1.png
+0
-0
Burger.pw.tsx_default_base-view-2.png
...der/__screenshots__/Burger.pw.tsx_default_base-view-2.png
+0
-0
Burger.pw.tsx_default_dark-mode-base-view-1.png
...enshots__/Burger.pw.tsx_default_dark-mode-base-view-1.png
+0
-0
Burger.pw.tsx_default_dark-mode-base-view-2.png
...enshots__/Burger.pw.tsx_default_dark-mode-base-view-2.png
+0
-0
NavigationDesktop.pw.tsx
ui/snippets/navigation/NavigationDesktop.pw.tsx
+2
-1
No files found.
playwright/fixtures/auth.ts
0 → 100644
View file @
8d6f06f3
import
type
{
BrowserContext
}
from
'
@playwright/test
'
;
export
default
function
authFixture
(
context
:
BrowserContext
)
{
context
.
addCookies
([
{
name
:
'
_explorer_key
'
,
value
:
'
foo
'
,
domain
:
'
localhost
'
,
path
:
'
/
'
}
]);
}
ui/snippets/header/Burger.pw.tsx
0 → 100644
View file @
8d6f06f3
import
{
test
,
expect
,
devices
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
authFixture
from
'
playwright/fixtures/auth
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
Burger
from
'
./Burger
'
;
test
.
use
({
viewport
:
devices
[
'
iPhone 13 Pro
'
].
viewport
});
test
(
'
base view
'
,
async
({
mount
,
page
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
Burger
/>
</
TestApp
>,
);
await
component
.
locator
(
'
svg[aria-label="Menu button"]
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
();
await
page
.
locator
(
'
button[aria-label="Network menu"]
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
();
});
test
.
describe
(
'
dark mode
'
,
()
=>
{
test
.
use
({
colorScheme
:
'
dark
'
});
test
(
'
base view
'
,
async
({
mount
,
page
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
Burger
/>
</
TestApp
>,
);
await
component
.
locator
(
'
svg[aria-label="Menu button"]
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
();
await
page
.
locator
(
'
button[aria-label="Network menu"]
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
();
});
});
test
.
describe
(
'
auth
'
,
()
=>
{
const
extendedTest
=
test
.
extend
({
context
:
({
context
},
use
)
=>
{
authFixture
(
context
);
use
(
context
);
},
});
extendedTest
(
'
base view
'
,
async
({
mount
,
page
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
Burger
/>
</
TestApp
>,
);
await
component
.
locator
(
'
svg[aria-label="Menu button"]
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
();
});
});
ui/snippets/header/Burger.tsx
View file @
8d6f06f3
...
...
@@ -29,6 +29,7 @@ const Burger = () => {
boxSize=
{
6
}
display=
"block"
color=
{
iconColor
}
aria
-
label=
"Menu button"
/>
</
Box
>
<
Drawer
...
...
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_auth-base-view-1.png
0 → 100644
View file @
8d6f06f3
24.4 KB
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_base-view-1.png
0 → 100644
View file @
8d6f06f3
27.2 KB
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_base-view-2.png
0 → 100644
View file @
8d6f06f3
24.5 KB
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_dark-mode-base-view-1.png
0 → 100644
View file @
8d6f06f3
28.1 KB
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_dark-mode-base-view-2.png
0 → 100644
View file @
8d6f06f3
25.1 KB
ui/snippets/navigation/NavigationDesktop.pw.tsx
View file @
8d6f06f3
...
...
@@ -2,6 +2,7 @@ import { Box, Flex } from '@chakra-ui/react';
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
authFixture
from
'
playwright/fixtures/auth
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
NavigationDesktop
from
'
./NavigationDesktop
'
;
...
...
@@ -30,7 +31,7 @@ test('no auth +@desktop-xl +@dark-mode-xl', async({ mount }) => {
test
.
describe
(
'
auth
'
,
()
=>
{
const
extendedTest
=
test
.
extend
({
context
:
({
context
},
use
)
=>
{
context
.
addCookies
([
{
name
:
'
_explorer_key
'
,
value
:
'
foo
'
,
domain
:
'
localhost
'
,
path
:
'
/
'
}
]
);
authFixture
(
context
);
use
(
context
);
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment