-
Notifications
You must be signed in to change notification settings - Fork 80
test: adapt UI e2e tests to prod environment #1271
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
Changes from all commits
24cfd61
d916910
90600a0
b7acc0f
4720dd0
7669ea8
d38f13c
d86580b
4b31e46
c48ad7d
2609acd
ec2f582
d1d37f0
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,5 +1,6 @@ | ||
| SSO_USERNAME=${SSO_USERNAME} | ||
| SSO_PASSWORD=${SSO_PASSWORD} | ||
| BASE_URL=${BASE_URL} | ||
| ENVIRONMENT=ui-e2e-tests | ||
| BROWSER=${BROWSER} | ||
| ENVIRONMENT=${ENVIRONMENT} | ||
| BROWSER=${BROWSER} | ||
| KUBECONFIG=${KUBECONFIG} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ package sandboxui | |
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
| "path/filepath" | ||
| "runtime" | ||
| "sync" | ||
|
|
@@ -15,6 +16,7 @@ import ( | |
| const ( | ||
| TestEnv = "ui-e2e-tests" | ||
| DevEnv = "dev" | ||
| ProdEnv = "prod" | ||
| ) | ||
|
|
||
| var ( | ||
|
|
@@ -62,8 +64,11 @@ func Setup(t *testing.T, testName string) playwright.Page { | |
| context, err := browser.NewContext(opts) | ||
| require.NoError(t, err) | ||
|
|
||
| // save trace | ||
| trace(t, context, testName) | ||
| // save trace only if not running in CI | ||
| // we do not want to expose sensitive information in CI | ||
| if os.Getenv("ARTIFACT_DIR") == "" { // not CI environment | ||
| trace(t, context, testName) | ||
| } | ||
|
Comment on lines
+67
to
+71
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. Don't disable tracing for every CI run.
🧰 Tools🪛 GitHub Check: SonarCloud Code Analysis[warning] 69-69: Remove this unnecessary variable declaration and use the expression directly in the condition. 🤖 Prompt for AI Agents |
||
|
|
||
| page, err := context.NewPage() | ||
| require.NoError(t, err) | ||
|
|
@@ -73,9 +78,9 @@ func Setup(t *testing.T, testName string) playwright.Page { | |
| login := NewLoginPage(page, env) | ||
| login.Navigate(t, baseURL) | ||
|
|
||
| if env == DevEnv { | ||
| if env == ProdEnv { | ||
| // handle cookie consent | ||
| // on dev environment, the cookie consent appears after the login page is loaded | ||
| // on prod environment, the cookie consent appears after the login page is loaded | ||
| handleCookiesConsent(t, page) | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.