appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
440 stars 179 forks source link

[Tag 2.2.2] ScrollUntilVisible don't work well #624

Open thuonglai opened 7 months ago

thuonglai commented 7 months ago

When i update from 1.17.1 to 2.2.2. My test case worked well in version 1.17.1 but not in 2.2.2. It sometime will not work. Seem it happen when has scrollUntil before it. I guess.

  1. First case Screenshot_1700450742

I scrollUntilVisible to click answer => It work. Then I click to button Next with funtion scrollUntilTapable => It not work and raise timeout. Appium log in here: https://gist.github.com/thuonglai/4c05db4ffd70239b41385378a33491f1

  1. Second case I scrollUntilVisible to select year but it scroll till the end of list. Screenshot_1700451074

Appium log in here : https://gist.github.com/thuonglai/3482327e66dc2f8e8b435ec7a50764ef

thuonglai commented 7 months ago
while (!isVisible && shouldRetry(startAt, waitTimeoutMilliseconds)) {
    (async () => {
      try {
        await waitFor(self, item, durationMilliseconds);
        isVisible = true;
      } catch (ign) {}
    })();

    try {
      await scroll(self, elementBase64, {
        dx: dxScroll,
        dy: dyScroll,
        durationMilliseconds,
        frequency
      });
    } catch { /* go to the next scroll */ }
  }

I think waitFor must wait in all waitTimeoutMilliseconds not in durationMilliseconds and retry. May be sometime, waitfor not execute and scroll over this element (in my second testcase). But i don't know why my first testcase happen. Button "Next" always display in 60s and waitFor not return true.

AYASGray commented 2 months ago

This fix in 2.5.1 works great on iOS simulated devices, but fails on real physical devices hosted on browserstack. Pre 2.5.1 it failed on both real and simulated.

thuonglai commented 2 months ago

I don't test on IOS. But it is working well on real device Android. Let me check it on IOS.

thuonglai commented 2 months ago

@AYASGray I test it on real device iOS and it working normal.