-
Notifications
You must be signed in to change notification settings - Fork 1.3k
UI Sync Int Tests fix TPS preference #8489
UI Sync Int Tests fix TPS preference #8489
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8489 +/- ##
============================================
+ Coverage 19.02% 19.06% +0.03%
Complexity 490 490
============================================
Files 320 320
Lines 12843 12838 -5
Branches 1688 1688
============================================
+ Hits 2443 2447 +4
+ Misses 10196 10187 -9
Partials 204 204
Continue to review full report at Codecov.
|
1009537
to
20e3da8
Compare
This PR fixes the TPS issue so that we can use it with the new prefs. Also, it adds a condition to run tests only on master as a start. I'm enabling only two tests at the moment to see how they work on the sim on the laptop in MTV. Then, there will be a follow up PR adjusting the timing issues and enabling the rest of tests. There was a change in fxawebchannel extension and stage sever stop working there, there is a patch to workaround that done by @csadilek (big thanks!!) |
@@ -207,8 +209,7 @@ class SyncIntegrationTest { | |||
} | |||
|
|||
fun historyAfterSyncIsShown() { | |||
val historyEntry = mDevice.findObject(By.text("http://www.example.com/")) | |||
historyEntry.isEnabled() | |||
mDevice.waitNotNull(Until.findObjects(By.text("http://www.example.com/")), TestAssetHelper.waitingTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wondering if we could use a static asset instead here, but I assume http://www.example.com is an URL used by TPS (and we can't change it), true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to investigate that, on iOS using a static asset did not work because the history was not properly recorded on the iOS device. Also, in this case we are checking on Fenix that the history created on Desktop is shown, so it is kind of static from Fenix side.
I will investigate if creating the history using a static asset on Fenix works, but if possible let's keep that for the follow up PR too
def test_sync_bookmark_from_desktop(tps, gradlewbuild): | ||
os.chdir('app/src/androidTest/java/org/mozilla/fenix/syncintegration/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this relative path gets repeated over and over. Not sure if it's possible to create a fixture for it instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that would be doable. Let me improve that in a follow up since now I would prefer check that these tests work on the MTV laptop 🙏
import org.mozilla.fenix.ext.components | ||
import org.mozilla.fenix.ui.robots.appContext | ||
|
||
class AppRequestInterceptor(private val context: Context) : RequestInterceptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this class? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the class that allows us to workaround the issue with fxawebchannel extension not working for stage. Otherwise we can not sync using stage server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comment to this class as it's not obvious, something like:
/**
* Overrides the application's request interceptor to deactivate the FxA web channel
* which is not supported on the staging servers.
*/
bf5e08d
to
166720a
Compare
@csadilek sorry for pinging you again, I know you are busy, but just in case this got out of you radar. Just to double check that is safe to land your patch as it is as part of this PR. Thanks again! |
166720a
to
d09bd20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add one comment (see below), and squash the commits before landing, but yes this is safe to land. It has no impact on app code, just makes FxA work in android tests.
import org.mozilla.fenix.ext.components | ||
import org.mozilla.fenix.ui.robots.appContext | ||
|
||
class AppRequestInterceptor(private val context: Context) : RequestInterceptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comment to this class as it's not obvious, something like:
/**
* Overrides the application's request interceptor to deactivate the FxA web channel
* which is not supported on the staging servers.
*/
Sync Int Tests fix TPS preference add webext navigation enable only two tests add comment as per reviewer suggestion
d09bd20
to
fa6998e
Compare
Sync integration tests were failing due to Bug 1610758 This PR fixes that
Pull Request checklist
After merge
To download an APK when reviewing a PR: