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

TabElement.getText() is empty when running tests on Firefox #1714

Open
mlindfors opened this issue Dec 15, 2023 · 1 comment
Open

TabElement.getText() is empty when running tests on Firefox #1714

mlindfors opened this issue Dec 15, 2023 · 1 comment
Labels

Comments

@mlindfors
Copy link

Problem

Currently TabElement.getText(), and consequently anything relying on the return value of that method, is broken when running tests using the latest Firefox. Instead of returning the tab title, the value is just empty.

Apparently this problem isn't limited to just the TabElement, it might just be that pretty much anything using getText() is not working correctly.

Steps to reproduce

To reproduce, get a Vaadin 23 skeleton starter project from start.vaadin.com, and add the following to the MainView class:

    	Tabs tabs = new Tabs();
    	tabs.add(new Tab("About"));
    	tabs.add(new Tab("Info"));
    	add(tabs);

Change the WebDriver in use from ChromeDriver to FirefoxDriver in AbstractTestView, run the application, and add the following test to the MainViewIT class and run it:

    @Test
    public void testTabs() {
    	TabsElement tabs = $(TabsElement.class).waitForFirst();
    	String title = tabs.getSelectedTabElement().getText();
    	int index = tabs.getTab("About");
    	System.out.println("About tab's index is " + index);
    	System.out.println("Selected tab's title text is " + title);
    }

You will end up with return values of "-1" and "". If you use tabs.getSelectedTabElement().getWrappedElement().getDomProperty("innerHTML"); you will get the Tab title, but of course the tabs.getTab("About"); will return -1 no matter what.

Expected result

The tab text and the tab index are returned properly. This happens when testing with Chrome or Safari.

Versions

macOS Sonoma 14.2
Verified with Vaadin 23.3.29, I would expect this to be similarly broken with Vaadin 24.
Firefox 120.0.1

@mshabarov mshabarov added the bug label Dec 15, 2023
@mshabarov
Copy link
Contributor

mshabarov commented Dec 18, 2023

Related issue vaadin/flow-components#5646.

Waits until Firefox 122 release, see vaadin/flow-components#5646 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🔖 Normal Priority (P2)
Development

No branches or pull requests

2 participants