Skip to content

Commit

Permalink
Fix playwright and enable in ITs (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps authored Jul 5, 2022
1 parent 6cb4025 commit ab8008d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euo pipefail

task --parallel test lint
4 changes: 2 additions & 2 deletions test/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ step_9_test_metrics()
run()
{
# run any pending db migrations
./bin/flipt migrate --config ./config/local.yml &> /dev/null
./bin/flipt migrate ---config ./test/config/test.yml &> /dev/null

./bin/flipt --config ./config/local.yml &> /dev/null &
./bin/flipt --config ./test/config/test.yml &> /dev/null &
echo $! > "$FLIPT_PID"

sleep 5
Expand Down
10 changes: 6 additions & 4 deletions test/ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ finish() {
run()
{
# run any pending db migrations
./bin/flipt migrate --config ./config/local.yml &> /dev/null
./bin/flipt migrate --config ./test/config/test.yml &> /dev/null

./bin/flipt --config ./config/local.yml &> /dev/null &
./bin/flipt --config ./test/config/test.yml &> /dev/null &
echo $! > "$FLIPT_PID"

port="${FLIPT_SERVER_HTTP_PORT:-8080}"

sleep 5

flipt_host="127.0.0.1:8080"
flipt_host="127.0.0.1:${port}"

echo -e "\e[32m \e[0m"
echo -e "\e[32m===========================================\e[0m"
Expand All @@ -29,7 +31,7 @@ run()

./test/helpers/wait-for-it/wait-for-it.sh "$flipt_host" -t 30

cd "ui" && npm test
cd "ui" && npm test && npx playwright test
}

run
2 changes: 1 addition & 1 deletion ui/e2e/createFlag.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
const { test, expect } = require("@playwright/test");

test("createFlag", async ({ page }) => {
await page.goto("/");
Expand Down
2 changes: 1 addition & 1 deletion ui/e2e/createSegment.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
const { test, expect } = require("@playwright/test");

test("createSegment", async ({ page }) => {
await page.goto("/");
Expand Down

0 comments on commit ab8008d

Please sign in to comment.