-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cypress dashboard and stabilize e2e tests #10807
Changes from all commits
68eab81
1a58979
6793f4e
9bb9894
7a13e6e
7c99376
198f237
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"projectId": "916nvw", | ||
"baseUrl": "http://localhost:3000", | ||
"testFiles": [ | ||
"base.spec.js", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
describe("Source main actions", () => { | ||
beforeEach(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is done to always start fresh from the new workspace, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that fakes the response of the workspaces to act like they have been through the initial setup flow. Otherwise the app would show the preference screen for those tests. This worked only so far because the onboarding test suit ran before this one and worked through that screen. But that requires those test suits to run in a specific dependent order, which we should not rely on (and recording is actually breaking that order). With faking this response slightly, we can make sure that tests won't run into the preference screen (or run into it, if needed), as we require, without being dependent on any other test suite. |
||
cy.initialSetupCompleted(); | ||
}); | ||
|
||
it("Create new source", () => { | ||
cy.createTestSource("Test source cypress"); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ import "./sidebar"; | |
import "./source"; | ||
import "./destination"; | ||
import "./connection"; | ||
import "./workspaces"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Cypress.Commands.add("initialSetupCompleted", (completed = true) => { | ||
// Modify the workspaces/list response to mark every workspace as "initialSetupComplete" to ensure we're not showing | ||
// the setup/preference page for any workspace if this method got called. | ||
cy.intercept("POST", "/api/v1/workspaces/list", (req) => { | ||
req.continue(res => { | ||
res.body.workspaces = res.body.workspaces.map(ws => ({ ...ws, initialSetupComplete: completed })); | ||
res.send(res.body); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,15 @@ mkdir -p /tmp/airbyte_local | |
|
||
# Detach so we can run subsequent commands | ||
VERSION=dev TRACKING_STRATEGY=logging docker-compose up -d | ||
trap 'echo "docker-compose logs:" && docker-compose logs -t --tail 1000 && docker-compose down && docker rm -f $(docker ps -q --filter name=airbyte_ci_pg)' EXIT | ||
trap 'echo "docker-compose logs:" && docker-compose logs -t --tail 1000 && docker-compose down && docker stop airbyte_ci_pg' EXIT | ||
|
||
docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=secret_password -e POSTGRES_DB=airbyte_ci --name airbyte_ci_pg postgres | ||
echo "Waiting for services to begin" | ||
sleep 30 # TODO need a better way to wait | ||
docker run --rm -d -p 5433:5432 -e POSTGRES_PASSWORD=secret_password -e POSTGRES_DB=airbyte_ci --name airbyte_ci_pg postgres | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Using |
||
echo "Waiting for health API to be available..." | ||
# Retry loading the health API of the server to check that the server is fully available | ||
until $(curl --output /dev/null --fail --silent --max-time 5 --head localhost:8001/api/v1/health); do | ||
echo "Health API not available yet. Retrying in 10 seconds..." | ||
sleep 10 | ||
done | ||
|
||
echo "Running e2e tests via gradle" | ||
SUB_BUILD=PLATFORM ./gradlew --no-daemon :airbyte-webapp-e2e-tests:e2etest | ||
SUB_BUILD=PLATFORM ./gradlew --no-daemon :airbyte-webapp-e2e-tests:e2etest -PcypressWebappKey=$CYPRESS_WEBAPP_KEY |
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.
ℹ️ This was (I guess) accidentally merged from https://github.com/airbytehq/airbyte/pull/9025/files