gradio/ui/playwright-setup.js
pngwn 26d2c190fc
add test infra + add browser tests to CI (#852)
* add test infra

* improve test setup and utils

* finish a test

* add browser tests to ci

* fix ci

* fix ci

* fix ci

* fix ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* fix ci

* update lockfile

* fix formatting

* install browser when not cached

* bust cache

* debug test in ci

* fix button label

* generate screenshots for failed tests

* generate screenshots for failed tests

* generate screenshots for failed tests

* fix tests

* clean uip debug logs

* add setuip + teardown to functional tests

* remove build from static checks
2022-03-23 15:19:12 +00:00

22 lines
531 B
JavaScript

import polka from "polka";
import sirv from "sirv";
import path from "path";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const template = path.join(__dirname, "..", "gradio", "templates", "frontend");
export default async function global_setup() {
const serve = sirv(template);
const app = polka()
.use(serve)
.listen("3000", () => {
console.log(`> Running on localhost: 3000`);
});
return () => {
app.server.close();
};
}