Skip to content

Test app window titles seem to be empty string #5116

Closed
@flimzy

Description

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

I'm trying to write a test to assert that a new window is properly opened. I've initialized a new temp app (app := test.NewTempApp(t)), then iterate over app.Driver().AllWindows(), but all windows Title() method returns an empty string.

To reproduce:

func Test_testWindow(t *testing.T) {
	a := test.NewTempApp(t)

	_ = a.NewWindow("test")
	_ = a.NewWindow("test")
	_ = a.NewWindow("test")
	_ = a.NewWindow("test")

	for i, w := range a.Driver().AllWindows() {
		t.Log(i, w.Title())
		if w.Title() == "test" {
			return
		}
	}
	t.Error("window not found")
}

Outputs:

$ go test -v -run=Test_testWindow
=== RUN   Test_testWindow
    about_test.go:24: 0 
    about_test.go:24: 1 
    about_test.go:24: 2 
    about_test.go:24: 3 
    about_test.go:24: 4 
    about_test.go:29: window not found
--- FAIL: Test_testWindow (0.00s)
FAIL
exit status 1
FAIL    gitlab.com/packthathouse/app/internal/app       0.008s

Is it possible to construct a solution with the existing API?

Yes.

Describe the solution you'd like to see.

I would like to see the window titles returned.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions