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

Add focus checking methods to graybox #4

Open
1 of 2 tasks
pauliusguzas opened this issue Jun 12, 2023 · 3 comments
Open
1 of 2 tasks

Add focus checking methods to graybox #4

pauliusguzas opened this issue Jun 12, 2023 · 3 comments
Assignees

Comments

@pauliusguzas
Copy link
Contributor

pauliusguzas commented Jun 12, 2023

  • atv - facing issues as webdriverio attribute focused does not change to true when element is focused, it always has value false. Also tried adding changed values of attributes to components in js of the app. But none of them seem to change the value returned in the app. Also tried wdio methods which return element color and other things but most of them are only implemented for browser automation
  • tvos
@pauliusguzas pauliusguzas self-assigned this Jun 12, 2023
@pauliusguzas
Copy link
Contributor Author

@pauliusguzas
Copy link
Contributor Author

    expectToBeFocusedById = async (selector: string) => {
        const element = await this.getElementById(selector);
        if (element) {
            await expect(element).toHaveAttribute('focused', 'true');
        }
    };

    expectToBeFocusedByText = async (selector: string) => {
        const element = await this.getElementByText(selector);
        if (element) {
            await expect(element).toHaveAttribute('focused', 'true');
        }
    };

    waitForFocusedById = async (selector: string) => {
        const element = await this.getElementById(selector);
        if (element) {
            await element.waitUntil(async function () {
                return (await element.getAttribute('focused')) === 'true';
            }, {
                timeout: 60000,
            });
        }
    };

    waitForFocusedByText = async (selector: string) => {
        const element = await this.getElementByText(selector);
        if (element) {
            await element.waitUntil(async function () {
                return (await element.getAttribute('focused')) === 'true';
            }, {
                timeout: 60000,
            });
        }
    };

@pauliusguzas
Copy link
Contributor Author

pauliusguzas commented Sep 6, 2023

@aurimasmi to test this:

  1. pull https://github.com/flexn-io/create/tree/chore/focus-checking-e2e
  2. do yarn bootstrap-clean
  3. do yarn e2e-template-tvos - pass
  4. do yarn e2e-template-androidtv - fail

To help development use appium inspector:

  1. install this https://github.com/appium/appium-inspector
  2. install appium globally: yarn global add appium
  3. install appium drivers: appium driver install xcuitest && appium driver install uiautomator2
  4. start appium server: appium
  5. configure appium inspector like below and click "Start Session"
    Screenshot 2023-09-06 at 11 23 00
  6. after navigating somewhere on simulator use this button on inspector to update app to latest state in inspector
    Screenshot 2023-09-06 at 11 21 53

P.S. https://github.com/flexn-io/graybox/tree/feat/tvs-focus-support here is branch with graybox updates

@pauliusguzas pauliusguzas removed this from the 1.0 milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant