diff options
author | Peter Zhang <peter@innocraft.com> | 2022-01-31 12:47:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 12:47:11 +0300 |
commit | ea3818a244d3a9b49d5743ebd7dedcd5d0004930 (patch) | |
tree | e466bc5ecb4f57ae3b9a9a8944198bc9f3bc8e63 /tests/UI | |
parent | ec58ab4606cbc6c7f7c3a7aa7f1e9cc5a88e5dfb (diff) |
add core updater with file access check (#18594)
* add core updater with file access check
add core updater with file access check
* update screen shot
update screen shot
* Update en.json
update to multiple support
* Update plugins/CoreUpdater/Updater.php
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* Update plugins/CoreUpdater/Updater.php
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* Update en.json
* Update en.json
update wording
* Adds update test
* fix branch before merge
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'tests/UI')
-rw-r--r-- | tests/UI/expected-screenshots/OneClickUpdate_update_fail_permission.png | 3 | ||||
-rw-r--r-- | tests/UI/specs/OneClickUpdate_spec.js | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/UI/expected-screenshots/OneClickUpdate_update_fail_permission.png b/tests/UI/expected-screenshots/OneClickUpdate_update_fail_permission.png new file mode 100644 index 0000000000..1a88203b40 --- /dev/null +++ b/tests/UI/expected-screenshots/OneClickUpdate_update_fail_permission.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:459df3d386cee7e977800e30f00f703de8d04f9c6a7f49d68a0e435a71561248 +size 66383 diff --git a/tests/UI/specs/OneClickUpdate_spec.js b/tests/UI/specs/OneClickUpdate_spec.js index e0029c36ba..a8f8c1a78d 100644 --- a/tests/UI/specs/OneClickUpdate_spec.js +++ b/tests/UI/specs/OneClickUpdate_spec.js @@ -7,6 +7,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +var fs = require('fs'), + path = require('../../lib/screenshot-testing/support/path'); + const request = require('request-promise'); const exec = require('child_process').exec; @@ -49,7 +52,19 @@ describe("OneClickUpdate", function () { expect(await page.screenshot({ fullPage: true })).to.matchImage('update_fail'); }); + it('should fail when a directory is not writable', async function () { + fs.chmodSync(path.join(PIWIK_INCLUDE_PATH, '/latestStableInstall/core'), 0o555); + await page.waitForTimeout(100); + await page.click('#updateUsingHttp'); + await page.waitForNetworkIdle(); + expect(await page.screenshot({ fullPage: true })).to.matchImage('update_fail_permission'); + }); + it('should update successfully and show the finished update screen', async function () { + fs.chmodSync(path.join(PIWIK_INCLUDE_PATH, '/latestStableInstall/core'), 0o777); + await page.waitForTimeout(100); + var url = await page.getWholeCurrentUrl(); + await page.goBack(); await page.click('#updateUsingHttp'); await page.waitForNetworkIdle(); await page.waitForSelector('.content'); |