-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from mruoss/playwright
add first test and run on CI
- Loading branch information
Showing
22 changed files
with
274 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
LIVEBOOK_TOKEN_ENABLED=0 | ||
ERL_AFLAGS = "-kernel shell_history enabled" | ||
KUBECONFIG = "~/.kube/config" | ||
KUBECONTEXT = "kind-kino-k8s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
env: | ||
KUBECONFIG: /home/runner/.kube/config | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .tool-versions | ||
|
||
- name: Setup elixir | ||
id: beam | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
version-file: .tool-versions | ||
version-type: strict | ||
install-rebar: true | ||
install-hex: true | ||
|
||
- name: install livebook | ||
run: mix escript.install --force hex livebook | ||
|
||
- uses: engineerd/[email protected] | ||
id: kind | ||
with: | ||
version: v0.20.0 | ||
name: kino-k8s | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run livebook | ||
env: | ||
LIVEBOOK_TOKEN_ENABLED: 0 | ||
run: livebook server & | ||
|
||
- name: Run Playwright tests | ||
env: | ||
KUBECONTEXT: '' | ||
run: KUBECONFIG="${KUBECONFIG}" npx playwright test | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ kino_k8s-*.tar | |
*node_modules/* | ||
|
||
*.livemd_files | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
[env] | ||
ERL_AFLAGS = "-kernel shell_history enabled" | ||
|
||
[tools] | ||
erlang = "26.1.2" | ||
elixir = "1.15.7" | ||
env_file = '.env' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node 18.18.1 | ||
kind 0.20.0 | ||
erlang 26.1.2 | ||
elixir 1.15.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { expect, test } from '@playwright/test' | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('http://localhost:8080/new') | ||
|
||
await page.getByText('Notebook dependencies and setup').click() | ||
await page | ||
.locator('#cell-editor-setup-primary') | ||
.getByRole('textbox') | ||
.fill(`Mix.install([{:kino_k8s, path: "${process.cwd()}"}])`) | ||
|
||
await page.getByRole('button', { name: 'Reconnect and setup' }).click() | ||
|
||
await expect(page.locator('#outputs-setup-2')).toHaveText(/:ok/, { | ||
timeout: 300000, | ||
}) | ||
|
||
const smart = page | ||
.locator('section') | ||
.first() | ||
.getByRole('button', { name: '+ Smart' }) | ||
.first() | ||
await smart.click() | ||
await page.getByRole('menuitem', { name: 'K8s - Cluster Connection' }).click() | ||
}) | ||
|
||
test.describe('File', () => { | ||
test('loads from local file', async ({ page }) => { | ||
const cell = page.locator('[data-smart-cell-js-view-ref]').first() | ||
const iframe = page.frameLocator('iframe').first() | ||
await iframe.getByTestId('source').fill(process.env.KUBECONFIG!) | ||
await iframe.getByTestId('context').fill(process.env.KUBECONTEXT!) | ||
await cell.locator('button[data-el-queue-cell-evaluation-button]').click() | ||
|
||
const result = page.frameLocator('iframe').nth(1).locator('body') | ||
await expect(result).toHaveText(/%K8s.Conn/) | ||
await expect(result).toHaveText(/K8s.Conn.Auth.Certificate/) | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.