Last active
October 29, 2015 19:33
-
-
Save snorremd/41689ef6473a25b9d602 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webdriverio = require('webdriverio'), | |
moment = require('moment'); | |
var options = { | |
desiredCapabilities: { | |
browserName: 'firefox' | |
} | |
}; | |
var password = process.env.FACEBOOK_PASSWORD, | |
email = process.env.FACEBOOK_EMAIL, | |
eventDescription = | |
`Event description here. | |
Supports multiline strings hooray!`, | |
date = moment().weekday(5).format('l'); | |
webdriverio | |
.remote(options) | |
.init() | |
.url('https://www.facebook.com/groups/000000000000000/') | |
.setValue('#email', email) | |
.setValue('#pass', password) | |
.click('input[name="login"]') | |
.click('a[href="/groups/000000000000000/events/"]') | |
.waitForExist('.fbCalendarHeader .uiHeaderActions > a[role="button"]', 10000) | |
.click('.fbCalendarHeader .uiHeaderActions > a[role="button"]') | |
.waitForExist('input[name="title"]', 10000) | |
.setValue('input[name="title"]', 'Event Name') | |
.setValue('textarea', eventDescription) | |
.setValue('input[name="location"]', 'Location Name') | |
.setValue('input[name="when_dateIntlDisplay"]', date) | |
.setValue('input[name="when_time_display_time"]', '4:00 pm') | |
.click('form > div > table > tbody > tr > td:nth-child(2) > button') | |
.title(function(err, res) { | |
console.log('Title was: ' + res.value); | |
}) | |
.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment