Skip to content
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

Test app window titles seem to be empty string #5116

Closed
2 tasks done
flimzy opened this issue Sep 6, 2024 · 2 comments
Closed
2 tasks done

Test app window titles seem to be empty string #5116

flimzy opened this issue Sep 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@flimzy
Copy link
Contributor

flimzy commented Sep 6, 2024

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.

@andydotxyz
Copy link
Member

Good catch on that one, we seemed to have been dropping the title parameter in the test driver. Fixed in the linked PR

@andydotxyz andydotxyz added the bug Something isn't working label Sep 6, 2024
@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Sep 6, 2024
@andydotxyz
Copy link
Member

Fixed on develop, will merge it into next release too

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants