Closed Bug 1079399 Opened 10 years ago Closed 10 years ago

Remove Gaiaapps.uninstall because it is unused

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

()

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
zcampbell
: review+
Details | Review
I have this code:
    def tearDown(self):
        if self.APP_INSTALLED:
            self.apps.uninstall(self.app_name)

When the test has been finished, the installed app (Calculator) is supposed to be uninstalled.
But that doesn't happen. That piece of code gets stuck on the Delete dialog:
Delete Calculator
Calculator and all of its data will be deleted
Cancel - Delete

This causes this specific test for me to fail when I run it for the 2nd time.
Apparently, the issue has to be fixed somewhere around here: http://mxr.mozilla.org/gaia/source/tests/atoms/gaia_apps.js#366
Yeah ie does not surprise me that this has rot. We used to use it but at the moment we don't use this method at all; we rely on cleanup_data() method in the setUp to configure the device because we found that when the device crashes the tearDown doesn't get executed. The setUp is much more trustworthy.

That said, this should be fixable and if someone does can they create a unit test for it?
test_homescreen_delete_app.py does it this way:
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/tests/functional/homescreen/test_homescreen_delete_app.py#54
self.homescreen.installed_app(self.test_data['name']).tap_delete_app().tap_confirm()
tap_delete_app returns ConfirmDialog.

http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/homescreen/regions/confirm_dialog.py

self.apps.uninstall is this:
http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#94

So I guess a gaia-ui-test just always has to add a ConfirmDialog.tap_confirm() to it.
(In reply to Martijn Wargers [:mwargers] (QA) from comment #3)
> So I guess a gaia-ui-test just always has to add a
> ConfirmDialog.tap_confirm() to it.

Yes I agree with this. It would not be consistent with the style of GaiaApps to have uninstall return the app object or a UI class.

Another alternative is to just remove the method entirely so it doesn't rot again. It's unused now so the impact is low.
Attached file patch
(In reply to Zac C (:zac) from comment #4)
> Another alternative is to just remove the method entirely so it doesn't rot
> again. It's unused now so the impact is low.

Yeah, I agree. It's unused and I don't need it, either.
Assignee: nobody → martijn.martijn
Attachment #8509983 - Flags: review?(zcampbell)
Summary: GaiaApps.uninstall doesn't work, gets stuck on the Delete dialog → Remove Gaiaapps.uninstall because it is unused
Comment on attachment 8509983 [details] [review]
patch

r+
Attachment #8509983 - Flags: review?(zcampbell) → review+
Merged:
https://github.com/mozilla-b2g/gaia/commit/df899a8988de61faf85ce0dd6a7a39cf92fe9042
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Haha, I readded this function again in bug 1150009, but this time it has some uses.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: