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

Commit

Permalink
fix(integration): ensure text box is visible before focusing
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Sep 6, 2023
1 parent 8e29da1 commit 8d279ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/integration/tag_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ resource "null_resource" "tags_e2e" {}
screenshot(t),
matchText(t, "//div[@role='alert']", "removed tag: bar"),
// add new tag
chromedp.Focus(`//input[@x-ref='input-search']`),
chromedp.Focus(`//input[@x-ref='input-search']`, chromedp.NodeVisible),
input.InsertText("baz"),
chromedp.Submit(`//input[@x-ref='input-search']`),
screenshot(t),
Expand Down
4 changes: 2 additions & 2 deletions internal/integration/team_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestIntegration_TeamUI(t *testing.T) {
chromedp.Click(`//div[@id='content-list']//a[text()='owners']`),
screenshot(t, "owners_team_page"),
// set focus to search box
chromedp.Focus(`//input[@x-ref='input-search']`),
chromedp.Focus(`//input[@x-ref='input-search']`, chromedp.NodeVisible),
input.InsertText(""),
// should trigger dropdown box showing both alice and bob
chromedp.WaitVisible(`//div[@x-ref='searchdrop']//button[text()='bob']`),
Expand All @@ -52,7 +52,7 @@ func TestIntegration_TeamUI(t *testing.T) {
// now demonstrate specifying a username that doesn't belong to an
// existing user. The dropdown box should prompt to create the user
// and add them to the team.
chromedp.Focus(`//input[@x-ref='input-search']`),
chromedp.Focus(`//input[@x-ref='input-search']`, chromedp.NodeVisible),
input.InsertText("sarah"),
matchRegex(t, `//div[@x-ref='searchdrop']//button`, `Create:.*sarah`),
// submit
Expand Down
2 changes: 1 addition & 1 deletion internal/integration/vcsprovider_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestIntegration_VCSProviderUI(t *testing.T) {
// enter fake github token and name
chromedp.Focus("textarea#token", chromedp.NodeVisible, chromedp.ByQuery),
input.InsertText("fake-github-personal-token"),
chromedp.Focus("input#name", chromedp.ByQuery),
chromedp.Focus("input#name", chromedp.ByQuery, chromedp.NodeVisible),
input.InsertText("my-token"),
// submit form to create provider
chromedp.Submit("textarea#token", chromedp.ByQuery),
Expand Down
6 changes: 3 additions & 3 deletions internal/integration/workspace_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestIntegration_WorkspaceUI(t *testing.T) {
// select trigger patterns strategy
chromedp.Click(`input#vcs-triggers-patterns`, chromedp.ByQuery),
// add glob patterns
chromedp.Focus(`#new_path`),
chromedp.Focus(`#new_path`, chromedp.NodeVisible),
input.InsertText(`/foo/*.tf`),
chromedp.Click(`button#add-pattern`, chromedp.ByQuery),
input.InsertText(`/bar/*.tf`),
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestIntegration_WorkspaceUI(t *testing.T) {
// tag regex strategy should be set
chromedp.WaitVisible(`input#vcs-triggers-tag:checked`, chromedp.ByQuery),
// set vcs branch
chromedp.Focus(`input#vcs-branch`, chromedp.ByQuery),
chromedp.Focus(`input#vcs-branch`, chromedp.ByQuery, chromedp.NodeVisible),
input.InsertText(`dev`),
// submit
chromedp.Submit(`//button[text()='Save changes']`),
Expand Down Expand Up @@ -152,7 +152,7 @@ func TestIntegration_WorkspaceUI(t *testing.T) {
// go to workspace settings
chromedp.Click(`//a[text()='settings']`),
// enter a description
chromedp.Focus(`textarea#description`, chromedp.ByQuery),
chromedp.Focus(`textarea#description`, chromedp.ByQuery, chromedp.NodeVisible),
input.InsertText(`my big fat workspace`),
// submit
chromedp.Submit(`//button[text()='Save changes']`),
Expand Down

0 comments on commit 8d279ae

Please sign in to comment.