Fix for failed tests

This commit is contained in:
Yuya Ochiai
2015-12-23 19:25:14 +09:00
parent d010d09ef4
commit 62b6e4c51b
4 changed files with 40 additions and 11 deletions

View File

@@ -80,18 +80,30 @@ describe('electron-mattermost', function() {
});
describe('index.html', function() {
before(function() {
fs.writeFileSync(config_file_path, JSON.stringify({
const config = {
version: 1,
teams: [{
name: 'example_1',
url: mattermost_url
}));
}, {
name: 'example_2',
url: mattermost_url
}]
};
before(function() {
fs.writeFileSync(config_file_path, JSON.stringify(config));
});
it('should set src of #mainWebview from config file', function(done) {
it('should set src of webview from config file', function(done) {
var client = webdriverio.remote(options);
client
.init()
.getAttribute('#mainWebview', 'src').then(function(attribute) {
attribute.should.equal(mattermost_url);
.getAttribute('.mattermostView', 'src').then(function(attribute) {
console.log(attribute);
attribute.forEach(function(attr, index) {
attr.should.equal(config.teams[index].url);
});
})
.end().then(function() {
done();