Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-03-16 04:41:28 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-03-16 04:41:28 +0300
commit1020053b55f397cbdd580a0116ca1f3bde37e7ba (patch)
tree545c03dc1981dc5d3323df954f59d1338d602c72 /tests
parent4c00874590f38e2fc4ce6247f63d01bdb60ce1cd (diff)
Moved UI tests into main ui tests directory
Diffstat (limited to 'tests')
m---------tests/UI/expected-ui-screenshots0
-rw-r--r--tests/UI/specs/CoreUpdaterCode_spec.js34
-rw-r--r--tests/UI/specs/CoreUpdaterDb_spec.js37
3 files changed, 71 insertions, 0 deletions
diff --git a/tests/UI/expected-ui-screenshots b/tests/UI/expected-ui-screenshots
-Subproject 560c44710748f4f27ceaee0955f59aa1336ee4a
+Subproject a5234a335229b74acb3132a0e9de10cd3abcc37
diff --git a/tests/UI/specs/CoreUpdaterCode_spec.js b/tests/UI/specs/CoreUpdaterCode_spec.js
new file mode 100644
index 0000000000..807810869b
--- /dev/null
+++ b/tests/UI/specs/CoreUpdaterCode_spec.js
@@ -0,0 +1,34 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * Installation screenshot tests.
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+describe("CoreUpdaterCode", function () {
+ this.timeout(0);
+
+ this.fixture = "Piwik\\Plugins\\CoreUpdater\\Test\\Fixtures\\FailUpdateHttpsFixture";
+
+ var url = "?module=CoreUpdater&action=newVersionAvailable";
+
+ it("should show a new version is available", function (done) {
+ expect.screenshot("newVersion").to.be.capture(function (page) {
+ page.load(url);
+ }, done);
+ });
+
+ it("should offer to update over http when updating over https fails", function (done) {
+ expect.screenshot("httpsUpdateFail").to.be.capture(function (page) {
+ page.click('#updateAutomatically');
+ }, done);
+ });
+
+ it("should show the update steps when updating over http succeeds", function (done) {
+ expect.screenshot("httpUpdateSuccess").to.be.capture(function (page) {
+ page.click('#updateUsingHttp');
+ }, done);
+ });
+});
diff --git a/tests/UI/specs/CoreUpdaterDb_spec.js b/tests/UI/specs/CoreUpdaterDb_spec.js
new file mode 100644
index 0000000000..f77776a4ca
--- /dev/null
+++ b/tests/UI/specs/CoreUpdaterDb_spec.js
@@ -0,0 +1,37 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * Installation screenshot tests.
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+describe("CoreUpdaterDb", function () {
+ this.timeout(0);
+
+ this.fixture = "Piwik\\Plugins\\CoreUpdater\\Test\\Fixtures\\DbUpdaterTestFixture";
+
+ before(function () {
+ testEnvironment.tablesPrefix = 'piwik_';
+ testEnvironment.save();
+ });
+
+ it("should start the updater when an old version of Piwik is detected in the DB", function (done) {
+ expect.screenshot("main").to.be.capture(function (page) {
+ page.load("");
+ page.evaluate(function () {
+ $('p').each(function () {
+ var replace = $(this).html().replace(/(?!1\.0)\d+\.\d+(\.\d+)?([\-a-z]*\d+)?/g, '');
+ $(this).html(replace);
+ });
+ });
+ }, done);
+ });
+
+ it("should show the donation form when the update process is complete", function (done) {
+ expect.screenshot("updated").to.be.capture(function (page) {
+ page.click('.submit');
+ }, done);
+ });
+});