Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
fix(integration): wait for alpinejs to load
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Sep 9, 2023
1 parent a333ee6 commit 346024e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/integration/variable_set_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestIntegration_VariableSetUI(t *testing.T) {
// go to org
chromedp.Navigate(organizationURL(svc.Hostname(), org.Name)),
// go to variable sets
chromedp.Click(`//a[text()='variable sets']`),
chromedp.Click(`//a[text()='variable sets']`), waitLoaded,
// click new variable set button
chromedp.Click(`button#new-variable-set-button`, chromedp.ByQuery),
// enter name
Expand All @@ -32,11 +32,11 @@ func TestIntegration_VariableSetUI(t *testing.T) {
// global radio button should be set by default
chromedp.WaitVisible(`input#global:checked`, chromedp.ByQuery),
// submit form
chromedp.Click(`//button[@id='save-variable-set-button']`),
chromedp.Click(`//button[@id='save-variable-set-button']`), waitLoaded,
// confirm variable set added
matchText(t, "//div[@role='alert']", "added variable set: global-1"),
// add a variable
chromedp.Click(`//button[@id='add-variable-button']`),
chromedp.Click(`//button[@id='add-variable-button']`), waitLoaded,
// enter key
chromedp.Focus("input#key", chromedp.NodeVisible, chromedp.ByQuery),
input.InsertText("foo"),
Expand All @@ -46,7 +46,7 @@ func TestIntegration_VariableSetUI(t *testing.T) {
// select terraform variable category
chromedp.Click("input#terraform", chromedp.ByQuery),
// submit form
chromedp.Click(`//button[@id='save-variable-button']`),
chromedp.Click(`//button[@id='save-variable-button']`), waitLoaded,
// confirm variable added
matchText(t, "//div[@role='alert']", "added variable: foo"),
},
Expand Down
4 changes: 2 additions & 2 deletions internal/integration/workspace_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ func TestIntegration_WorkspaceUI(t *testing.T) {
browser.Run(t, ctx, chromedp.Tasks{
chromedp.Navigate(workspaceURL(daemon.Hostname(), org.Name, "workspace-1")),
// go to workspace settings
chromedp.Click(`//a[text()='settings']`),
chromedp.Click(`//a[text()='settings']`), waitLoaded,
// enter a description
chromedp.Focus(`textarea#description`, chromedp.ByQuery, chromedp.NodeVisible),
input.InsertText(`my big fat workspace`),
// submit
chromedp.Submit(`//button[text()='Save changes']`),
chromedp.Submit(`//button[text()='Save changes']`), waitLoaded,
// confirm updated
matchText(t, "//div[@role='alert']", "updated workspace"),
// confirm updated description shows up
Expand Down

0 comments on commit 346024e

Please sign in to comment.