Integrated babel-plugin-react-remove-properties for Selenium tests

This commit is contained in:
Oleksandr Zhurbenko 2017-11-04 00:38:44 -07:00
parent 716de591ed
commit 9934d90fff
10 changed files with 59 additions and 36 deletions

View File

@ -0,0 +1,9 @@
{
"env": {
"production": {
"plugins": [
"react-remove-properties"
]
}
}
}

View File

@ -15,7 +15,7 @@ cfs:power-queue
cfs:reactive-list
cfs:micro-queue
reactive-var@1.0.11
ecmascript@0.8.1
ecmascript@0.8.2
react-meteor-data
standard-minifier-css@1.3.4
standard-minifier-js@2.1.1

View File

@ -1 +1 @@
METEOR@1.5.1
METEOR@1.5.2

View File

@ -4,13 +4,13 @@ allow-deny@1.0.6
amplify@1.0.0
arunoda:npm@0.2.6
autoupdate@1.3.12
babel-compiler@6.19.4
babel-compiler@6.20.0
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
blaze@2.3.2
blaze-tools@1.0.10
boilerplate-generator@1.1.1
boilerplate-generator@1.2.0
caching-compiler@1.1.9
caching-html-compiler@1.1.2
callback-hook@1.0.10
@ -23,17 +23,17 @@ check@1.2.5
clinical:nightwatch@2.0.1
coffeescript@1.12.6_1
ddp@1.3.0
ddp-client@2.0.0
ddp-client@2.1.0
ddp-common@1.2.9
ddp-server@2.0.0
deps@1.0.12
diff-sequence@1.0.7
dynamic-import@0.1.1
ecmascript@0.8.2
ecmascript@0.8.3
ecmascript-runtime@0.4.1
ecmascript-runtime-client@0.4.3
ecmascript-runtime-server@0.4.1
ejson@1.0.13
ejson@1.0.14
fastclick@1.0.13
francocatena:status@1.5.3
geojson-utils@1.0.10
@ -46,24 +46,25 @@ launch-screen@1.1.1
livedata@1.0.18
logging@1.1.17
mdg:validation-error@0.5.1
meteor@1.7.0
meteor@1.7.1
meteor-platform@1.2.6
meteorblackbelt:underscore-deep@0.0.4
meteorspark:util@0.2.0
minifier-css@1.2.16
minifier-js@2.1.1
minimongo@1.2.1
minifier-js@2.1.2
minimongo@1.3.0
mizzao:timesync@0.5.0
mobile-status-bar@1.0.14
modules@0.9.2
modules@0.10.0
modules-runtime@0.8.0
mongo@1.1.22
mongo@1.2.0
mongo-dev-server@1.0.1
mongo-id@1.0.6
nathantreid:css-modules@2.7.3
npm-mongo@2.2.30
observe-sequence@1.0.16
ordered-dict@1.0.9
promise@0.8.9
promise@0.9.0
raix:eventemitter@0.1.3
random@1.0.10
react-meteor-data@0.2.15
@ -90,5 +91,5 @@ udondan:yml@3.2.2_1
ui@1.0.13
underscore@1.0.10
url@1.1.0
webapp@1.3.17
webapp@1.3.18
webapp-hashing@1.0.9

View File

@ -157,17 +157,17 @@ class AudioModal extends Component {
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.microphoneLabel)}
icon={'unmute'}
icon="unmute"
circle
size={'jumbo'}
size="jumbo"
onClick={this.handleGoToEchoTest}
/>
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
icon={'listen'}
icon="listen"
circle
size={'jumbo'}
size="jumbo"
onClick={this.handleJoinListenOnly}
/>
</span>
@ -257,17 +257,21 @@ class AudioModal extends Component {
onRequestClose={this.closeModal}
>
{ isConnecting ? null :
<header className={styles.header}>
<header
data-test="audioModalHeader"
className={styles.header}
>
<h3 className={styles.title}>
{ content ?
this.contents[content].title :
intl.formatMessage(intlMessages.audioChoiceLabel)}
</h3>
<Button
data-test="modalBaseCloseButton"
className={styles.closeBtn}
label={intl.formatMessage(intlMessages.closeLabel)}
icon={'close'}
size={'md'}
icon="close"
size="md"
hideLabel
onClick={this.closeModal}
/>

View File

@ -25,7 +25,9 @@ const defaultProps = {
export default class DropdownContent extends Component {
render() {
const { placement, className, children, style } = this.props;
const {
placement, className, children, style,
} = this.props;
const { dropdownToggle, dropdownShow, dropdownHide } = this.props;
const placementName = placement.split(' ').join('-');
@ -40,6 +42,7 @@ export default class DropdownContent extends Component {
<div
style={style}
aria-expanded={this.props['aria-expanded']}
data-test="dropdownContent"
className={cx(styles.content, styles[placementName], className)}
>
<div className={styles.scrollable}>

View File

@ -35,8 +35,10 @@ export default class DropdownListItem extends Component {
}
render() {
const { id, label, description, children, injectRef, tabIndex, onClick, onKeyDown,
className, style } = this.props;
const {
id, label, description, children, injectRef, tabIndex, onClick, onKeyDown,
className, style,
} = this.props;
return (
<li
@ -50,6 +52,7 @@ export default class DropdownListItem extends Component {
className={cx(styles.item, className)}
style={style}
role="menuitem"
data-test={this.props['data-test']}
>
{
children || this.renderDefault()

View File

@ -111,6 +111,7 @@ class SettingsDropdown extends Component {
>
<DropdownTrigger tabIndex={0}>
<Button
data-test="settingsDropdownTrigger"
label={intl.formatMessage(intlMessages.optionsLabel)}
icon="more"
ghost
@ -149,6 +150,7 @@ class SettingsDropdown extends Component {
label={intl.formatMessage(intlMessages.leaveSessionLabel)}
description={intl.formatMessage(intlMessages.leaveSessionDesc)}
onClick={() => mountModal(<LogoutConfirmationContainer />)}
data-test="settingsDropdownLogoutButton"
/>
</DropdownList>
</DropdownContent>

View File

@ -52,6 +52,7 @@
},
"devDependencies": {
"autoprefixer": "~7.1.6",
"babel-plugin-react-remove-properties": "~0.2.5",
"chai": "~4.1.2",
"eslint": "~4.9.0",
"eslint-config-airbnb": "~16.1.0",

View File

@ -8,30 +8,30 @@ function expectImageMatch(results, errorMessage) {
}
describe('Screenshots:', function() {
browser.windowHandleSize({width: 1920, height: 1200});
it('Join Audio modal looks good', function() {
HomePage.login('testuser', 'Demo Meeting');
browser.element('.ReactModal__Content--after-open').waitForExist(7000);
expectImageMatch(browser.checkElement('.ReactModal__Content--after-open'), 'Join Audio modal isn\'t the same');
browser.element('[data-test=audioModalHeader]').waitForExist(7000);
expectImageMatch(browser.checkElement('.ReactModal__Content--after-open._imports_ui_components_audio_audio_modal__styles__modal'), 'Join Audio modal isn\'t the same');
});
it('Home page viewport looks good', function() {
$('._imports_ui_components_audio_audio_modal__styles__closeBtn').click();
$('[data-test=modalBaseCloseButton]').click();
expectImageMatch(browser.checkViewport(), 'Home page viewport isn\'t the same');
});
it('Settings dropdown looks good', function() {
browser.element('.icon-bbb-more').waitForExist(2000);
$('.icon-bbb-more').click();
browser.element('._imports_ui_components_nav_bar__styles__right ._imports_ui_components_dropdown__styles__dropdown ._imports_ui_components_dropdown__styles__content[aria-expanded="true"]').waitForExist(2000);
expectImageMatch(browser.checkElement('._imports_ui_components_nav_bar__styles__right ._imports_ui_components_dropdown__styles__dropdown ._imports_ui_components_dropdown__styles__content[aria-expanded="true"]'), 'Settings dropdown isn\'t the same');
browser.element('[data-test=settingsDropdownTrigger]').waitForExist(2000);
$('[data-test=settingsDropdownTrigger]').click();
browser.element('[data-test=settingsDropdownTrigger] + [data-test=dropdownContent][aria-expanded="true"]').waitForExist(2000);
expectImageMatch(browser.checkElement('[data-test=settingsDropdownTrigger] + [data-test=dropdownContent][aria-expanded="true"]'), 'Settings dropdown isn\'t the same');
});
it('Logout popup looks good', function() {
browser.element('.icon-bbb-logout').waitForExist(2000);
$('.icon-bbb-logout').click();
browser.element('._imports_ui_components_modal_fullscreen__styles__modal').waitForExist(2000);
expectImageMatch(browser.checkElement('._imports_ui_components_modal_fullscreen__styles__modal'));
browser.element('[data-test=settingsDropdownLogoutButton]').waitForExist(2000);
$('[data-test=settingsDropdownLogoutButton]').click();
browser.element('.ReactModal__Content--after-open._imports_ui_components_modal_fullscreen__styles__modal').waitForExist(2000);
expectImageMatch(browser.checkElement('.ReactModal__Content--after-open._imports_ui_components_modal_fullscreen__styles__modal'));
});
});