-
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.
- Loading branch information
1 parent
0a03c3f
commit 8dac82c
Showing
5 changed files
with
222 additions
and
48 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
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,44 +1,46 @@ | ||
{ | ||
"name": "app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --check . && eslint .", | ||
"format": "prettier --write ." | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-auto": "^2.0.0", | ||
"@sveltejs/adapter-vercel": "^3.1.0", | ||
"@sveltejs/kit": "^1.27.7", | ||
"@typescript-eslint/eslint-plugin": "^6.13.2", | ||
"@typescript-eslint/parser": "^6.13.2", | ||
"autoprefixer": "^10.4.16", | ||
"eslint": "^8.55.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.30.0", | ||
"postcss": "^8.4.32", | ||
"prettier": "^3.1.1", | ||
"prettier-plugin-svelte": "^3.0.0", | ||
"svelte": "^4.2.8", | ||
"svelte-check": "^3.6.0", | ||
"tailwindcss": "^3.3.6", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^4.5.1" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@popperjs/core": "^2.11.8", | ||
"flowbite": "^2.2.0", | ||
"flowbite-svelte": "^0.44.20", | ||
"svelte-french-toast": "^1.2.0", | ||
"tailwind-merge": "^2.1.0", | ||
"zod": "^3.22.4", | ||
"zod-form-data": "^2.0.2" | ||
} | ||
"name": "app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --check . && eslint .", | ||
"format": "prettier --write ." | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.40.1", | ||
"@sveltejs/adapter-auto": "^2.0.0", | ||
"@sveltejs/adapter-vercel": "^3.1.0", | ||
"@sveltejs/kit": "^1.27.7", | ||
"@types/node": "^20.10.4", | ||
"@typescript-eslint/eslint-plugin": "^6.13.2", | ||
"@typescript-eslint/parser": "^6.13.2", | ||
"autoprefixer": "^10.4.16", | ||
"eslint": "^8.55.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.30.0", | ||
"postcss": "^8.4.32", | ||
"prettier": "^3.1.1", | ||
"prettier-plugin-svelte": "^3.0.0", | ||
"svelte": "^4.2.8", | ||
"svelte-check": "^3.6.0", | ||
"tailwindcss": "^3.3.6", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^4.5.1" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@popperjs/core": "^2.11.8", | ||
"flowbite": "^2.2.0", | ||
"flowbite-svelte": "^0.44.20", | ||
"svelte-french-toast": "^1.2.0", | ||
"tailwind-merge": "^2.1.0", | ||
"zod": "^3.22.4", | ||
"zod-form-data": "^2.0.2" | ||
} | ||
} |
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,77 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
testDir: './tests', | ||
/* 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'] }, | ||
}, | ||
|
||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
|
||
{ | ||
name: 'webkit', | ||
use: { ...devices['Desktop Safari'] }, | ||
}, | ||
|
||
/* 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 start', | ||
// url: 'http://127.0.0.1:3000', | ||
// reuseExistingServer: !process.env.CI, | ||
// }, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('test page load', async ({ page }) => { | ||
await page.goto('http://localhost:5173/'); | ||
await expect(page.getByRole('heading', { name: '🐜 Minimise for Python Tutor' })).toBeVisible(); | ||
await expect(page.getByText('/5600')).toBeVisible(); | ||
}); | ||
|
||
test('test minimise', async ({ page }) => { | ||
await page.goto('http://localhost:5173/'); | ||
await page.getByPlaceholder('Your python code...').click(); | ||
await page | ||
.getByPlaceholder('Your python code...') | ||
.fill( | ||
'"""Hello world"""\n\n\ndef main():\n """Hello world"""\n print("hi" + "bye")\n\n\nmain()' | ||
); | ||
await page.getByRole('button', { name: 'Get link' }).click(); | ||
await expect(page.getByRole('heading', { name: 'Minimised code' })).toBeVisible(); | ||
await page.getByText('Your code was reduced by 98').click(); | ||
await page.locator('#link').click(); | ||
await expect(page.locator('#link')).toBeVisible(); | ||
await page.getByRole('button', { name: 'Show Code' }).click(); | ||
await page.getByRole('textbox', { name: 'Your python code...' }).click(); | ||
}); | ||
|
||
// test('test minimise tiny', async ({ page }) => { | ||
// await page.goto('http://localhost:5173/'); | ||
// await page.getByPlaceholder('Your python code...').click(); | ||
// await page | ||
// .getByPlaceholder('Your python code...') | ||
// .fill( | ||
// '"""Hello world"""\n\n\ndef main():\n """Hello world"""\n print("hi" + "bye")\n\n\nmain()' | ||
// ); | ||
// await page.getByLabel('Tiny Indent').check(); | ||
// await page.getByRole('button', { name: 'Get link' }).click(); | ||
// await expect(page.getByRole('heading', { name: 'Minimised code' })).toBeVisible(); | ||
// await page.getByText('Your code was reduced by 98').click(); | ||
// await page.locator('#link').click(); | ||
// await expect(page.locator('#link')).toBeVisible(); | ||
// await page.getByRole('button', { name: 'Show Code' }).click(); | ||
// await page.getByRole('textbox', { name: 'Your python code...' }).click(); | ||
// }); |
8dac82c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
minimise-python-tutor-api – ./api
minimise-python-tutor-api-git-main-jimbonothing64.vercel.app
minimise-python-tutor-usb1.vercel.app
minimise-python-tutor-api-jimbonothing64.vercel.app