Commit 805c8cb4 authored by Saturnino Abril's avatar Saturnino Abril Committed by Harrison Healey

add channel header dropdown page object and some tests to channel header (#1947)

parent 74c3c439
......@@ -84,4 +84,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -16,7 +16,7 @@ module.exports = {
baseURL: 'https://selenium-release.storage.googleapis.com',
},
firefox: {
version: '0.20.1',
version: '0.23.0',
arch: process.arch,
baseURL: 'https://github.com/mozilla/geckodriver/releases/download',
},
......
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
const channelHeaderDropdownCommands = {
navigateToPage() {
return this.waitForElementVisible('@channelHeaderDropdownMenu');
},
};
module.exports = {
url: function() { // eslint-disable-line object-shorthand
return this.api.launchUrl;
},
commands: [channelHeaderDropdownCommands],
sections: {
channelHeaderDropdownMenu: {
selector: '#channelHeaderDropdownMenu',
elements: {
channelViewInfo: {selector: '#channelViewInfo'},
channelManageMembers: {selector: '#channelManageMembers'},
channelNotificationsGroup: {selector: '#channelNotificationsGroup'},
channelMute: {selector: '#channelMute'},
channelUnmute: {selector: '#channelUnmute'},
channelEditHeader: {selector: '#channelEditHeader'},
channelEditPurpose: {selector: '#channelEditPurpose'},
channelRename: {selector: '#channelRename'},
},
},
},
};
......@@ -3,10 +3,20 @@
const centerChannelHeaderCommands = {
navigateToPage() {
return this.waitForElementVisible('@headerContainer');
return this.waitForElementVisible('@channelHeader');
},
navigateToChannelHeaderDropdown() {
return this.
section.channelHeader.
click('@channelHeaderDropdownButton').
section.channelHeaderInfo.
waitForElementVisible('@channelHeaderDropdownMenu');
},
};
const channelHeaderDropdownButton = {selector: '#channelHeaderDropdownButton'};
const channelHeaderDropdownIcon = {selector: '#channelHeaderDropdownIcon'};
module.exports = {
url: function() { // eslint-disable-line object-shorthand
return this.api.launchUrl;
......@@ -22,8 +32,8 @@ module.exports = {
toggleFavorite: {selector: '#toggleFavorite'},
channelHeaderTitle: {selector: '#channelHeaderTitle'},
channelHeaderDescription: {selector: '#channelHeaderDescription'},
channelHeaderDropdownButton: {selector: '#channelHeaderDropdownButton'},
channelHeaderDropdownIcon: {selector: '#channelHeaderDropdownIcon'},
channelHeaderDropdownButton,
channelHeaderDropdownIcon,
channelHeaderDropdownMenu: {selector: '#channelHeaderDropdownMenu'},
},
},
......@@ -48,6 +58,8 @@ module.exports = {
channelHeaderPinButton: {selector: '#channelHeaderPinButton'},
channelHeaderMentionButton: {selector: '#channelHeaderMentionButton'},
channelHeaderFlagButton: {selector: '#channelHeaderFlagButton'},
channelHeaderDropdownIcon,
channelHeaderDropdownButton,
},
},
},
......
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
module.exports = {
'@tags': ['channel_header_dropdown'],
before: (client) => {
const testUser = client.globals.testUsers.test;
const loginPage = client.page.loginPage();
loginPage.navigate().
login(testUser.email, testUser.password);
},
after: (client) => client.end(),
'Channel header dropdown - element check': (client) => {
const channelHeaderPage = client.page.channelHeaderPage();
channelHeaderPage.navigateToChannelHeaderDropdown();
const channelHeaderDropdownPage = client.page.channelHeaderDropdownPage();
channelHeaderDropdownPage.expect.section('@channelHeaderDropdownMenu').to.be.visible;
const channelHeaderDropdownMenuSection = channelHeaderDropdownPage.section.channelHeaderDropdownMenu;
channelHeaderDropdownMenuSection.
assert.visible('@channelViewInfo').
assert.containsText('@channelViewInfo', 'View Info').
assert.visible('@channelManageMembers').
assert.containsText('@channelManageMembers', 'View Members').
assert.visible('@channelNotificationsGroup').
assert.containsText('@channelNotificationsGroup', 'Notification Preferences').
assert.visible('@channelMute').
assert.containsText('@channelMute', 'Mute Channel').
assert.elementNotPresent('@channelUnmute').
assert.visible('@channelEditHeader').
assert.containsText('@channelEditHeader', 'Edit Channel Header').
assert.visible('@channelEditPurpose').
assert.containsText('@channelEditPurpose', 'Edit Channel Purpose').
assert.visible('@channelRename').
assert.containsText('@channelRename', 'Rename Channel');
const channelHeaderInfoSection = channelHeaderPage.section.channelHeader.section.channelHeaderInfo;
channelHeaderInfoSection.click('@channelHeaderDropdownButton');
},
'Channel header dropdown - check mute channel then mute': (client) => {
const channelHeaderPage = client.page.channelHeaderPage();
channelHeaderPage.navigateToChannelHeaderDropdown();
const channelHeaderDropdownPage = client.page.channelHeaderDropdownPage();
channelHeaderDropdownPage.expect.section('@channelHeaderDropdownMenu').to.be.visible;
const channelHeaderDropdownMenuSection = channelHeaderDropdownPage.section.channelHeaderDropdownMenu;
channelHeaderDropdownMenuSection.
assert.visible('@channelMute').
assert.elementNotPresent('@channelUnmute');
channelHeaderDropdownMenuSection.click('@channelMute');
},
'Channel header dropdown - check unmute channel then unmute': (client) => {
const channelHeaderPage = client.page.channelHeaderPage();
channelHeaderPage.navigateToChannelHeaderDropdown();
const channelHeaderDropdownPage = client.page.channelHeaderDropdownPage();
channelHeaderDropdownPage.expect.section('@channelHeaderDropdownMenu').to.be.visible;
const channelHeaderDropdownMenuSection = channelHeaderDropdownPage.section.channelHeaderDropdownMenu;
channelHeaderDropdownMenuSection.
assert.elementNotPresent('@channelMute').
assert.visible('@channelUnmute');
channelHeaderDropdownMenuSection.click('@channelUnmute');
},
};
......@@ -19,7 +19,8 @@ module.exports = {
channelHeaderSection.
assert.visible('@channelHeaderPinButton').
assert.visible('@channelHeaderMentionButton').
assert.visible('@channelHeaderFlagButton');
assert.visible('@channelHeaderFlagButton').
assert.visible('@channelHeaderDropdownButton');
channelHeaderSection.expect.section('@channelHeaderInfo').to.be.visible;
const channelHeaderInfoSection = channelHeaderSection.section.channelHeaderInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment