From c6b30a75b0b73443add3418b1b724051177ba714 Mon Sep 17 00:00:00 2001 From: Wolfram Esser Date: Tue, 10 Jan 2017 08:43:40 +0100 Subject: [PATCH] Fix: 4minitz! => 4Minitz in browser title Refactoring of E2E tests to no spread the expected browser title over each and every test suite --- client/4minitz.html | 2 +- tests/end2end/ActionItem-test.js | 1 - tests/end2end/ActionItemResponsibles-test.js | 1 - tests/end2end/Attachments-test.js | 1 - tests/end2end/InfoItems-test.js | 1 - tests/end2end/ItemDetails-test.js | 1 - tests/end2end/LDAP-test.js | 2 -- tests/end2end/Labels-test.js | 1 - tests/end2end/MeetingSeries-test.js | 1 - tests/end2end/MeetingSeriesEdit-test.js | 1 - tests/end2end/MeetingSeriesEditUsers-test.js | 1 - tests/end2end/MeetingSeriesItemList-test.js | 1 - tests/end2end/MeetingSeriesItemsTab-test.js | 1 - tests/end2end/MeetingSeriesTopicList-test.js | 1 - tests/end2end/Minutes-test.js | 1 - tests/end2end/MinutesFinalize-test.js | 1 - tests/end2end/MinutesParticipants-test.js | 1 - tests/end2end/Routing-test.js | 1 - tests/end2end/SendAgenda.js | 1 - tests/end2end/StickyInfoItems-test.js | 1 - tests/end2end/Topics-test.js | 1 - tests/end2end/TopicsResponsibles-test.js | 1 - tests/end2end/helpers/E2EApp.js | 6 +++++- 23 files changed, 6 insertions(+), 24 deletions(-) diff --git a/client/4minitz.html b/client/4minitz.html index bbd6294b6..ab49bcc47 100644 --- a/client/4minitz.html +++ b/client/4minitz.html @@ -1,5 +1,5 @@ - 4minitz! + 4Minitz! diff --git a/tests/end2end/ActionItem-test.js b/tests/end2end/ActionItem-test.js index 22ae788ed..29c1f9cf8 100644 --- a/tests/end2end/ActionItem-test.js +++ b/tests/end2end/ActionItem-test.js @@ -45,7 +45,6 @@ describe('ActionItems', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/ActionItemResponsibles-test.js b/tests/end2end/ActionItemResponsibles-test.js index a18feadb2..1436c32b2 100644 --- a/tests/end2end/ActionItemResponsibles-test.js +++ b/tests/end2end/ActionItemResponsibles-test.js @@ -45,7 +45,6 @@ describe('ActionItems Responsibles', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/Attachments-test.js b/tests/end2end/Attachments-test.js index d84e031b9..0f341c088 100644 --- a/tests/end2end/Attachments-test.js +++ b/tests/end2end/Attachments-test.js @@ -25,7 +25,6 @@ describe('Attachments', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; _lastMeetingName = getNewMeetingName(); diff --git a/tests/end2end/InfoItems-test.js b/tests/end2end/InfoItems-test.js index bee5f44c9..875850c9a 100644 --- a/tests/end2end/InfoItems-test.js +++ b/tests/end2end/InfoItems-test.js @@ -34,7 +34,6 @@ describe('Info Items', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/ItemDetails-test.js b/tests/end2end/ItemDetails-test.js index dfeb5215e..48317e4b0 100644 --- a/tests/end2end/ItemDetails-test.js +++ b/tests/end2end/ItemDetails-test.js @@ -36,7 +36,6 @@ describe('Item Details', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/LDAP-test.js b/tests/end2end/LDAP-test.js index c145c1c6f..00b9bc104 100644 --- a/tests/end2end/LDAP-test.js +++ b/tests/end2end/LDAP-test.js @@ -27,8 +27,6 @@ describe('LDAP', function () { beforeEach("make sure test user is logged out and on the start page", function () { E2EApp.logoutUser(); - - expect(browser.getTitle()).to.equal('4minitz!'); expect(E2EApp.isLoggedIn()).to.be.false; }); diff --git a/tests/end2end/Labels-test.js b/tests/end2end/Labels-test.js index cc5c07fa5..2668811ee 100644 --- a/tests/end2end/Labels-test.js +++ b/tests/end2end/Labels-test.js @@ -32,7 +32,6 @@ describe('Labels', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect(E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/MeetingSeries-test.js b/tests/end2end/MeetingSeries-test.js index a7ab1e6dd..cb1aa96c5 100644 --- a/tests/end2end/MeetingSeries-test.js +++ b/tests/end2end/MeetingSeries-test.js @@ -6,7 +6,6 @@ import { E2EMeetingSeries } from './helpers/E2EMeetingSeries' describe('MeetingSeries', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; }); diff --git a/tests/end2end/MeetingSeriesEdit-test.js b/tests/end2end/MeetingSeriesEdit-test.js index 7cdde53aa..72daa1c85 100644 --- a/tests/end2end/MeetingSeriesEdit-test.js +++ b/tests/end2end/MeetingSeriesEdit-test.js @@ -14,7 +14,6 @@ describe('MeetingSeries Editor', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/MeetingSeriesEditUsers-test.js b/tests/end2end/MeetingSeriesEditUsers-test.js index 46e5a1ca7..51056873c 100644 --- a/tests/end2end/MeetingSeriesEditUsers-test.js +++ b/tests/end2end/MeetingSeriesEditUsers-test.js @@ -16,7 +16,6 @@ describe('MeetingSeries Editor Users', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/MeetingSeriesItemList-test.js b/tests/end2end/MeetingSeriesItemList-test.js index 453065f21..382fa3006 100644 --- a/tests/end2end/MeetingSeriesItemList-test.js +++ b/tests/end2end/MeetingSeriesItemList-test.js @@ -14,7 +14,6 @@ describe('MeetingSeries Items list', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect(E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/MeetingSeriesItemsTab-test.js b/tests/end2end/MeetingSeriesItemsTab-test.js index 3c6f40b59..6be49bce9 100644 --- a/tests/end2end/MeetingSeriesItemsTab-test.js +++ b/tests/end2end/MeetingSeriesItemsTab-test.js @@ -13,7 +13,6 @@ describe('MeetingSeries Items Tab', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect(E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/MeetingSeriesTopicList-test.js b/tests/end2end/MeetingSeriesTopicList-test.js index 6054097b8..5a2288b04 100644 --- a/tests/end2end/MeetingSeriesTopicList-test.js +++ b/tests/end2end/MeetingSeriesTopicList-test.js @@ -13,7 +13,6 @@ describe('MeetingSeries complete Topic list', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect(E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/Minutes-test.js b/tests/end2end/Minutes-test.js index 90e34762d..ef885f337 100644 --- a/tests/end2end/Minutes-test.js +++ b/tests/end2end/Minutes-test.js @@ -7,7 +7,6 @@ import { E2EMinutes } from './helpers/E2EMinutes' describe('Minutes', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; }); diff --git a/tests/end2end/MinutesFinalize-test.js b/tests/end2end/MinutesFinalize-test.js index 3ed6c3cd8..3279bd785 100644 --- a/tests/end2end/MinutesFinalize-test.js +++ b/tests/end2end/MinutesFinalize-test.js @@ -15,7 +15,6 @@ describe('Minutes Finalize', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; }); diff --git a/tests/end2end/MinutesParticipants-test.js b/tests/end2end/MinutesParticipants-test.js index 4c27b4abd..7744294f1 100644 --- a/tests/end2end/MinutesParticipants-test.js +++ b/tests/end2end/MinutesParticipants-test.js @@ -16,7 +16,6 @@ describe('Minutes Participants', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/Routing-test.js b/tests/end2end/Routing-test.js index 437a7d847..6ff58e511 100644 --- a/tests/end2end/Routing-test.js +++ b/tests/end2end/Routing-test.js @@ -12,7 +12,6 @@ describe('Routing', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/SendAgenda.js b/tests/end2end/SendAgenda.js index ab5c7aba0..a79629329 100644 --- a/tests/end2end/SendAgenda.js +++ b/tests/end2end/SendAgenda.js @@ -17,7 +17,6 @@ describe('Send agenda', function () { E2EMails.resetSentMailsDb(); E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/StickyInfoItems-test.js b/tests/end2end/StickyInfoItems-test.js index 1cc54ae3e..7d226ee04 100644 --- a/tests/end2end/StickyInfoItems-test.js +++ b/tests/end2end/StickyInfoItems-test.js @@ -36,7 +36,6 @@ describe('Sticky Info Items', function () { beforeEach("make sure test user is logged in, create series and add minutes", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingName = getNewMeetingName(); diff --git a/tests/end2end/Topics-test.js b/tests/end2end/Topics-test.js index e8c3bf1a7..47cbd824c 100644 --- a/tests/end2end/Topics-test.js +++ b/tests/end2end/Topics-test.js @@ -13,7 +13,6 @@ describe('Topics', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/TopicsResponsibles-test.js b/tests/end2end/TopicsResponsibles-test.js index 49775be25..c5d791d82 100644 --- a/tests/end2end/TopicsResponsibles-test.js +++ b/tests/end2end/TopicsResponsibles-test.js @@ -14,7 +14,6 @@ describe('Topics Responsibles', function () { beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); - expect(browser.getTitle()).to.equal('4minitz!'); expect (E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; diff --git a/tests/end2end/helpers/E2EApp.js b/tests/end2end/helpers/E2EApp.js index de98773a0..6ccc6647c 100644 --- a/tests/end2end/helpers/E2EApp.js +++ b/tests/end2end/helpers/E2EApp.js @@ -3,6 +3,8 @@ import { E2EGlobal } from './E2EGlobal' export class E2EApp { + static titlePrefix = "4Minitz!"; + // Calls the server method to clean database and create fresh test users static resetMyApp (skipUsers) { try { @@ -28,6 +30,7 @@ export class E2EApp { E2EGlobal.waitSomeTime(); } E2EApp._currentlyLoggedInUser = ""; + expect(browser.getTitle()).to.equal(E2EApp.titlePrefix); }; static loginLdapUserWithCredentials(username, password, autoLogout) { @@ -103,7 +106,7 @@ export class E2EApp { static launchApp () { browser.url(E2EGlobal.SETTINGS.e2eUrl); - if (browser.getTitle() != "4minitz!") { + if (browser.getTitle() != E2EApp.titlePrefix) { throw new Error("App not loaded. Unexpected title "+browser.getTitle()+". Please run app with 'meteor npm run test:end2end:server'") } }; @@ -133,6 +136,7 @@ export class E2EApp { if (! E2EApp.isOnStartPage()) { E2EGlobal.saveScreenshot("gotoStartPage2"); } + expect(browser.getTitle()).to.equal(E2EApp.titlePrefix); expect (E2EApp.isOnStartPage(), "gotoStartPage()").to.be.true; };