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

Port Facebook from WA2 #720

Open
wants to merge 7 commits into
base: next
Choose a base branch
from
Open

Conversation

JaviMerino
Copy link

No description provided.

Copy link
Contributor

@setrofim setrofim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please collapse modifying commits into the first facebook commit.

* Update the facebook status
*/
@Test
public void runWorkload() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you break this up into several methods each performing a single logical step of execution, and the run method should be just a simple sequence of steps. That will make it a lot easier to maintain this.

disable online updates, which helps to tackle problem of uncertain
behavier during facebook workload run.]

"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workload require an internet connection so the workload attribute requires_network should be set to True to allow the workload to fail quicker if no network is detected.

.className("android.webkit.WebView").index(0));
clickOnSearchResult.clickTopLeft();

clickUiObject(BY_DESC, "Amol Kamble", "android.view.View", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on my test device, the text for "Amol Kamlbe" is contained within the "text" field instead of the "description" field. This will probably need to check for both.

if LooseVersion(self.apk_version) > LooseVersion(self.max_apk_version):
msg = "APK version not supported. Maximum version supported: {}".format(self.max_apk_version)
raise WorkloadError(msg)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct place to be doing this check as this would cause the workload to fail unnecessarily late in the execution and will not deal with multiple versions of the apk being available correctly. Both in the case of there being multiple apks available on the host system, which could result in an incorrect apk being selected during initialization only to fail here in setup and in the event of a pre-installed version on the target when prefer_host_package is False.

I would suggest instead that the maximum version is passed as an extra parameter during the initialization of the ApkFile object and used when matching for an apk on the host system in resolve_package_from_host and the installed version on the target will also need to be checked in resolve_package_from_target with the appropriate error message added to the resolve_package method of workload.

@@ -0,0 +1,44 @@
# Copyright 2013-2015 ARM Limited
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message references the wrong issue, it should be #704

@JaviMerino
Copy link
Author

JaviMerino commented Apr 24, 2018

Thanks for the review. I am afraid I do not have time to work on getting Facebook in WA3 anymore, so I do not think I am able to act on it.

Javi Merino added 7 commits February 11, 2019 15:45
Currently WA3 infers the activity from the "aapt dump badging" output,
looking for launching-activity.  In some apks (e.g. facebook), thaapt
doesn't report any launchable activity.  Let subclasses of ApkWorkload
specify their activity, which overrides the one guessed from the aapt
dump.
… that need it

The ui automation of most workloads only work for given versions of
the apk.  Let subclasses of ApkWorkload specify the maximum apk
version that the current ui automation support, and bail out if the
installed version is greater than what we support.
Clicking on the top left of the WebView with the results doesn't work
for all screen sizes.  On devices in landscape mode, there is padding
around the elements, so the top left pixel is not part of the first
search result.

Find the ui object corresponding to the first search result by
content-description and class as that is a more reliable way of
clicking on things than by position.
The search box for friends updates as you type characters, so type
them one by one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants