Skip to content

Commit

Permalink
Fix: 4minitz! => 4Minitz in browser title
Browse files Browse the repository at this point in the history
Refactoring of E2E tests to no spread the expected browser title over each and every test suite
  • Loading branch information
derwok committed Jan 10, 2017
1 parent 7eb5f8c commit c6b30a7
Show file tree
Hide file tree
Showing 23 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion client/4minitz.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<title>4minitz!</title>
<title>4Minitz!</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- make site responsive! -->

<link rel="apple-touch-icon-precomposed" sizes="57x57" href="apple-touch-icon-57x57.png" />
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/ActionItem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/ActionItemResponsibles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/Attachments-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/InfoItems-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/ItemDetails-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions tests/end2end/LDAP-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
1 change: 0 additions & 1 deletion tests/end2end/Labels-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeries-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeriesEdit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeriesEditUsers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeriesItemList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeriesItemsTab-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MeetingSeriesTopicList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/Minutes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MinutesFinalize-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
1 change: 0 additions & 1 deletion tests/end2end/MinutesParticipants-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/Routing-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/SendAgenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/StickyInfoItems-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/Topics-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion tests/end2end/TopicsResponsibles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
6 changes: 5 additions & 1 deletion tests/end2end/helpers/E2EApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -28,6 +30,7 @@ export class E2EApp {
E2EGlobal.waitSomeTime();
}
E2EApp._currentlyLoggedInUser = "";
expect(browser.getTitle()).to.equal(E2EApp.titlePrefix);
};

static loginLdapUserWithCredentials(username, password, autoLogout) {
Expand Down Expand Up @@ -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'")
}
};
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit c6b30a7

Please sign in to comment.