[Flatfish] marionette test on tablet

RESOLVED FIXED

Status

Testing Graveyard
JSMarionette
RESOLVED FIXED
5 years ago
6 months ago

People

(Reporter: gduan, Assigned: gduan)

Tracking

Details

(Whiteboard: [Flatfish only][developer+])

Attachments

(3 attachments, 3 obsolete attachments)

As far as I know, tablet is different with mobile for below items
1. screen size
2. no hardware home button
3. no mobileconnection and telephony
4. different apps preinstalled and wallpaper

How to write UI test cases specifically on tablet device?
Blocks: 903304

Comment 1

5 years ago
Well writing it is the same as for a phone device but I'm most interested in whether you can run them at all? Does it have an engineering build on it?

I expect a lot of our app objects will be not relevant as judging by what I saw of the tablet when I had a play the UI was very different.

Updated

5 years ago
Component: Gaia::UI Tests → JSMarionette
Product: Firefox OS → Testing
Hi Zac,
actually, I'm not quite sure what you mean in comment 1 . So far as I know, we need to assign screen size of b2g when launch the UI test at least, since the UI will eventually go differently by device size.

What I think is we can start a marionette test with some arg like below,
var client = marionette.client({screen: {width: 1080, height: 800}});

So, I try to modify something as below,
https://github.com/cctuan/mozilla-runner/blob/master/lib/run.js#L22
and
https://github.com/cctuan/marionette-b2gdesktop-host/blob/master/index.js#L94
and I also need to modify here (wip)
https://github.com/cctuan/marionette-js-runner/blob/master/lib/childrunner.js#L227

Comment 3

5 years ago
Oh I thought you meant actually running them on the Flatfish device but it seems you mean just running them on desktopb2g with a bigger screen.
I don't know enough about marionette-js to help, sorry.
Created attachment 830080 [details]
PR to master, mozilla-runner
Created attachment 830081 [details]
PR to master, marionette-b2gdesktop-host
Created attachment 830084 [details]
PR to master, marionette-js-runner
Comment on attachment 830080 [details]
PR to master, mozilla-runner

><!DOCTYPE html><meta charset="utf-8"><meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/mozilla-runner/pull/3"><title>Bugzilla Code Review</title><p>You can review this patch at <a href="https://github.com/mozilla-b2g/mozilla-runner/pull/3">https://github.com/mozilla-b2g/mozilla-runner/pull/3</a>, or wait 5 seconds to be redirected there automatically.</p>
Comment on attachment 830080 [details]
PR to master, mozilla-runner

><!DOCTYPE html><meta charset="utf-8"><meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/mozilla-runner/pull/3"><title>Bugzilla Code Review</title><p>You can review this patch at <a href="https://github.com/mozilla-b2g/mozilla-runner/pull/3">https://github.com/mozilla-b2g/mozilla-runner/pull/3</a>, or wait 5 seconds to be redirected there automatically.</p>
Created attachment 830097 [details]
PR to master, mozilla-runner
Attachment #830080 - Attachment is obsolete: true
Assignee: nobody → gduan
Attachment #830081 - Flags: review?(jlal)
Attachment #830084 - Flags: review?(jlal)
Attachment #830097 - Flags: review?(jlal)
Comment on attachment 830084 [details]
PR to master, marionette-js-runner

Some questions here please re-set the flag (or come find me on IRC)
Attachment #830084 - Flags: review?(jlal)
Created attachment 830724 [details]
PR to master,mozilla-runner
Attachment #830097 - Attachment is obsolete: true
Attachment #830084 - Flags: review?(jlal)
Attachment #830724 - Flags: review?(jlal)
For now, I don't see the necessity to put resolution in global if we'd like to check all the images are replaced with higher resolution or not. Because on different resolution, most of UX are the same so far, only images are replaced. I suggest we can write separate test script for it.
Comment on attachment 830081 [details]
PR to master, marionette-b2gdesktop-host

r=me with one strong objection to the use of JSON.stringify (see github)
Attachment #830081 - Flags: review?(jlal) → review+
Comment on attachment 830084 [details]
PR to master, marionette-js-runner

but! we need to write an integration test for this... You can hack on this without publishing modules by using npm link. Mainly I want to ensure that we pass the screen option and that it effects the window.innerWidth|Height
Attachment #830084 - Flags: review?(jlal) → review+
Comment on attachment 830724 [details]
PR to master,mozilla-runner

https://github.com/mozilla-b2g/mozilla-runner/commit/9af8302e451cc1afe66b5bebb00fdc5c63bffe99

Sorry for the confusion about this one... thanks for the update this is much better!
Attachment #830724 - Flags: review?(jlal) → review+
Comment on attachment 830084 [details]
PR to master, marionette-js-runner

oops... resetting flag for final integration tests (we spoke about this on irc)
Attachment #830084 - Flags: review+
This looks good! Please address the small comments I made in the host / mozilla-runner but in marionette-js-runner I would like to see some tests that test the whole new set of changes. ( you can use npm link ).
Thanks for advice, updated and merge to master,
https://github.com/mozilla-b2g/marionette-b2gdesktop-host/commit/ac29338d65b984fe0e12fd9beb3e83e8101a873b

(In reply to James Lal [:lightsofapollo] from comment #14)
> Comment on attachment 830081 [details]
> PR to master, marionette-b2gdesktop-host
> 
> r=me with one strong objection to the use of JSON.stringify (see github)
It seems that I need to hack on marionette-b2gdesktop-host and marionette-js-runner's package.json to download right package, right?
(In reply to James Lal [:lightsofapollo] from comment #15)
> Comment on attachment 830084 [details]
> PR to master, marionette-js-runner
> 
> but! we need to write an integration test for this... You can hack on this
> without publishing modules by using npm link. Mainly I want to ensure that
> we pass the screen option and that it effects the window.innerWidth|Height
Created attachment 831973 [details]
PR to master, marionette-b2gdesktop-host

Backout my commit from marionette-b2gdesktop-host as below, and will replace it with this PR which use npm link to get latest mozilla-runner module.

https://github.com/mozilla-b2g/marionette-b2gdesktop-host/commit/451dc103ba7126da5980f3da582c454098a6f6d6
Attachment #830724 - Attachment is obsolete: true
Comment on attachment 830081 [details]
PR to master, marionette-b2gdesktop-host

Obsolete this one, since the npm link need to update
Attachment #830081 - Attachment is obsolete: true
Comment on attachment 831973 [details]
PR to master, marionette-b2gdesktop-host

npm link is updated.
Attachment #831973 - Attachment description: PR to master → PR to master, marionette-b2gdesktop-host
Attachment #830724 - Attachment description: PR to master → PR to master,mozilla-runner
Attachment #830724 - Attachment is obsolete: false
(In reply to James Lal [:lightsofapollo] from comment #15)
> Comment on attachment 830084 [details]
> PR to master, marionette-js-runner
> 
> but! we need to write an integration test for this... You can hack on this
> without publishing modules by using npm link. Mainly I want to ensure that
> we pass the screen option and that it effects the window.innerWidth|Height

Hi James,

Why do we just publish the marionette-b2gdesktop-host and mozilla-runner module once r+? Then we could write the tests for marionette-js-runner with the hack.

Thanks.
Flags: needinfo?(jlal)
Sorry- I did not say that but that is also what I think is best! There is one problem with the package.json https://github.com/mozilla-b2g/marionette-b2gdesktop-host/pull/12#discussion-diff-7652959R17

That is ready to land/publish after... I will make sure evanxd is on that module.
Flags: needinfo?(jlal)
Just wanted to mention my work here: https://bugzilla.mozilla.org/show_bug.cgi?id=938021 turned out to be very similar to what we are doing here but it resizes on the fly instead of during startup (which does effect things)
I think my patch can help to assign the orientation during startup. 
From my understanding, the resize and mediaquery.match event are triggered when innerWidth or innerHeight is larger than another. And of course, in CSS, portrait and landscape also depends on these two values.

BTW, I think marionette-b2gdesktop-host is ready to land, if you agree.

(In reply to James Lal [:lightsofapollo] from comment #26)
> Just wanted to mention my work here:
> https://bugzilla.mozilla.org/show_bug.cgi?id=938021 turned out to be very
> similar to what we are doing here but it resizes on the fly instead of
> during startup (which does effect things)
Flags: needinfo?(jlal)
b2g-desktop: https://github.com/mozilla-b2g/marionette-b2gdesktop-host/commit/178cd10b006f8805a060508a871f4691c12923e3

You can ping evanxd (who should be much easier to reach! when/if you need to publish packages...) I will publish vbumps to the runner/host today.
Flags: needinfo?(jlal)
marionette test is indeed needed for tablet. mark it to 1.3+
blocking-b2g: --- → 1.3+
Whiteboard: [Flatfish only][developer+]
Landed the patches and also landed the vbump into gaia: https://github.com/mozilla-b2g/gaia/commit/7d068d2ae650e9abf55025bee827e8892432d830
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
status-firefox28: --- → fixed

Updated

6 months ago
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.