|
| 1 | +import {LoginPage} from './Page objects/LoginPage'; |
| 2 | +import {SettingsPage} from './Page objects/SettingsPage'; |
| 3 | +import {MainPage} from './Page objects/MainPage'; |
| 4 | +import {default as data} from './data'; |
| 5 | +import {browser} from 'protractor'; |
| 6 | + |
| 7 | +const loginPage: LoginPage = new LoginPage(); |
| 8 | +const settingsPage: SettingsPage = new SettingsPage(); |
| 9 | +const mainPage: MainPage = new MainPage(); |
| 10 | + |
| 11 | + |
| 12 | +// testing reset button |
| 13 | +describe('Reset button in login page section of Settings', function () { |
| 14 | + // refresh and get back to login page by signing out |
| 15 | + beforeAll(function (done) { |
| 16 | + browser.get('/'); |
| 17 | + loginPage.login(); |
| 18 | + mainPage.advancedButton.click(); |
| 19 | + mainPage.settingsButton.click(); |
| 20 | + settingsPage.LoginPage.resetButton.click(); |
| 21 | + browser.refresh(); |
| 22 | + settingsPage.signOut(); |
| 23 | + done(); |
| 24 | + }); |
| 25 | +// get back to settings page by logging in, clicking Advanced -> Settings |
| 26 | + afterAll(function (done) { |
| 27 | + loginPage.login(); |
| 28 | + mainPage.advancedButton.click(); |
| 29 | + mainPage.settingsButton.click(); |
| 30 | + done(); |
| 31 | + }); |
| 32 | + it('should reset login page image', function (done) { |
| 33 | + expect(browser.isElementPresent(loginPage.loginPageImageMatcher)) |
| 34 | + .toBeTruthy(); |
| 35 | + done(); |
| 36 | + }); |
| 37 | + it('should reset login page main text', function (done) { |
| 38 | + expect(browser.isElementPresent(loginPage.loginPageMainTextMatcher)).toBeTruthy(); |
| 39 | + expect(loginPage.loginPageMainText.getText()) |
| 40 | + .toEqual(data.LoginPageSettings.defaultSettings.loginPageMainText); |
| 41 | + done(); |
| 42 | + }); |
| 43 | + it('should reset login page secondary text', function (done) { |
| 44 | + expect(browser.isElementPresent(loginPage.loginPageSecondaryTextMatcher)).toBeTruthy(); |
| 45 | + expect(loginPage.loginPageSecondaryText.getText()) |
| 46 | + .toEqual(data.LoginPageSettings.defaultSettings.loginPageSecondaryText); |
| 47 | + done(); |
| 48 | + }); |
| 49 | +}); |
| 50 | + |
| 51 | +// testing login page section of settings |
| 52 | +xdescribe('Settings in Login Page section', () => { |
| 53 | +// reset in login page section and refresh page after each test case |
| 54 | + afterEach((done) => { |
| 55 | + loginPage.login(); |
| 56 | + mainPage.advancedButton.click(); |
| 57 | + mainPage.settingsButton.click(); |
| 58 | + done(); |
| 59 | + }); |
| 60 | + |
| 61 | + it('should hide logo in header', (done) => { |
| 62 | + settingsPage.LoginPage.loginPageImageHideButton.click(); |
| 63 | + settingsPage.saveAndRefresh(); |
| 64 | + settingsPage.signOut(); |
| 65 | + expect(browser.isElementPresent(loginPage.loginPageImageMatcher)).toBeTruthy(); |
| 66 | + done(); |
| 67 | + }); |
| 68 | + |
| 69 | + it('should change Main text in header', function (done) { |
| 70 | + done(); |
| 71 | + }); |
| 72 | + |
| 73 | + it('should change secondary text', function (done) { |
| 74 | + done(); |
| 75 | + }); |
| 76 | + |
| 77 | + it('should hide main text', function (done) { |
| 78 | + done(); |
| 79 | + }); |
| 80 | + |
| 81 | + it('should hide secodary text', function (done) { |
| 82 | + done(); |
| 83 | + }); |
| 84 | + |
| 85 | + xit('should be able to change logo file', function () { |
| 86 | + // Will be implemented soon |
| 87 | + }); |
| 88 | + |
| 89 | +}); |
| 90 | + |
| 91 | + |
0 commit comments