Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
131
Issues
131
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
gargantext
purescript-gargantext
Commits
b5dd80a6
Commit
b5dd80a6
authored
Mar 19, 2025
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Tests] Playwright scaffolding
parent
cedf7e8b
Pipeline
#7461
passed with stages
in 38 minutes and 28 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
1 deletion
+114
-1
.gitignore
.gitignore
+6
-0
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
example.spec.js
e2e/example.spec.js
+21
-0
flake.nix
flake.nix
+15
-1
playwright.config.js
playwright.config.js
+71
-0
No files found.
.gitignore
View file @
b5dd80a6
...
...
@@ -50,3 +50,9 @@ bundle.js
# IDE specific
.vscode
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
.gitlab-ci.yml
View file @
b5dd80a6
...
...
@@ -54,6 +54,7 @@ test:
script
:
-
nix --extra-experimental-features "nix-command flakes" run .#compile
-
nix --extra-experimental-features "nix-command flakes" run .#test-ps
-
nix --extra-experimental-features "nix-command flakes" run .#test-e2e
-
nix-collect-garbage --delete-older-than 14d
e2e/example.spec.js
0 → 100644
View file @
b5dd80a6
// @ts-check
import
{
test
,
expect
}
from
'@playwright/test'
;
test
(
'has title'
,
async
({
page
})
=>
{
await
page
.
goto
(
'http://localhost:8008/'
);
// Expect a title "to contain" a substring.
await
expect
(
page
).
toHaveTitle
(
/CNRS GarganText/
);
});
/*
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
*/
flake.nix
View file @
b5dd80a6
...
...
@@ -138,7 +138,21 @@
echo "Testing"
npm run test
''
;
};
};
test-e2e
=
pkgs
.
writeShellApplication
{
name
=
"test-e2e"
;
runtimeInputs
=
[
compile
]
++
dependencies
++
[
pkgs
.
playwright-test
pkgs
.
playwright-driver
.
browsers
];
text
=
''
set -e
compile
echo "E2E testing"
export PLAYWRIGHT_BROWSERS_PATH=
${
pkgs
.
playwright-driver
.
browsers
}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
playwright test
''
;
};
repl
=
pkgs
.
writeShellApplication
{
name
=
"repl"
;
runtimeInputs
=
[
compile
]
++
dependencies
;
...
...
playwright.config.js
0 → 100644
View file @
b5dd80a6
// @ts-check
import
{
defineConfig
,
devices
}
from
'@playwright/test'
;
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });
/**
* @see https://playwright.dev/docs/test-configuration
*/
export
default
defineConfig
({
testDir
:
'./e2e'
,
/* Run tests in files in parallel */
fullyParallel
:
true
,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly
:
!!
process
.
env
.
CI
,
/* Retry on CI only */
retries
:
process
.
env
.
CI
?
2
:
0
,
/* Opt out of parallel tests on CI. */
workers
:
process
.
env
.
CI
?
1
:
undefined
,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter
:
'html'
,
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use
:
{
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace
:
'on-first-retry'
,
},
/* Configure projects for major browsers */
projects
:
[
{
name
:
'chromium'
,
use
:
{
...
devices
[
'Desktop Chrome'
]
},
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
/* Run your local dev server before starting the tests */
webServer
:
{
command
:
'npm run server'
,
url
:
'http://127.0.0.1:8008'
,
// reuseExistingServer: !process.env.CI,
},
});
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