Signing in via e2e and posting comment.

This commit is contained in:
David Jay
2016-11-21 21:23:48 -05:00
parent 4adba83c7b
commit dd060c5fd1
5 changed files with 14 additions and 8 deletions
@@ -44,7 +44,7 @@ const SignInContent = ({handleChange, formData, ...props}) => (
<div className={styles.action}>
{
!props.auth.isLoading ?
<Button type="submit" cStyle="black" className={styles.signInButton}>
<Button id='coralLogInButton' type="submit" cStyle="black" className={styles.signInButton}>
{lang.t('signIn.signIn')}
</Button>
:
@@ -126,8 +126,8 @@ class SignInContainer extends Component {
render() {
const {auth, showSignInDialog} = this.props;
return (
<div>
<Button onClick={showSignInDialog} id='coralSignInButton'>
<div id='coralSignInButton'>
<Button onClick={showSignInDialog}>
Sign in to comment
</Button>
<SignDialog
+1 -1
View File
@@ -4,7 +4,7 @@ module.exports = {
const {baseUrl} = browser.globals;
browser
.url(baseUrl)
.assert.title('Talk - Coral (Beta)')
.assert.title('Coral Talk')
.waitForElementPresent('body', 1000);
},
after: client => {
+8 -3
View File
@@ -4,7 +4,8 @@ const fetch = require('node-fetch');
const mockComment = 'This is a test comment.';
const mockUser = {
email: 'test@test.com',
email: `${new Date().getTime()}@test4.com`,
name: 'Test User',
pw: 'testtesttest'
}
@@ -26,16 +27,20 @@ module.exports = {
client.resizeWindow(1200, 800)
.url(client.globals.baseUrl)
.frame('coralStreamIframe')
.waitForElementVisible('#commentBox', 1000)
.waitForElementVisible('#coralSignInButton', 2000)
.click('#coralSignInButton')
.click('#coralSignInButton button')
.waitForElementVisible('#coralRegister', 1000)
.click('#coralRegister')
.waitForElementVisible('#email', 1000)
.setValue('#email', mockUser.email)
.setValue('#displayName', mockUser.name)
.setValue('#password', mockUser.pw)
.setValue('#confirmPassword', mockUser.pw)
.click('#coralSignUpButton')
.waitForElementVisible('#commentBox', 1000)
.waitForElementVisible('#coralLogInButton', 10000)
.click('#coralLogInButton')
.waitForElementVisible('#commentBox', 3000)
.setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment)
.click('#commentBox .coral-plugin-commentbox-button')
.waitForElementVisible('.comment', 1000)
+2 -1
View File
@@ -13,6 +13,7 @@
width:500px;
}
</style>
<title><%= title %></title>
</head>
<body>
<main>
@@ -33,7 +34,7 @@
<!--- Script --->
<script type='text/javascript' src='https://pym.nprapps.org/pym.v1.min.js'></script>
<script>
var pymParent = new pym.Parent('coralStreamEmbed', '/embed/stream', {title: 'Talk Comments'});
var pymParent = new pym.Parent('coralStreamEmbed', '/embed/stream', {title: 'Talk Comments', id:'coralStreamIframe'});
pymParent.onMessage('height', function(height) {
document.querySelector('#coralStreamEmbed iframe').height = height + 'px';
});