Skip to content

Commit

Permalink
Speakers page sessions now redirects to particular session (#1474)
Browse files Browse the repository at this point in the history
* Moved to previous version and fixed errors in https://eventyay.com/api/v1/events/257 app generation (#1473)

* Wrote selenium test for JumpTosession and changed redirection url to session page

* Try to fix travis timeout

* Fixed codacy issues

* Restored travis.yml from development branch
  • Loading branch information
agbilotia1998 authored and mariobehling committed Nov 2, 2017
1 parent dd19e47 commit 685c827
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 353 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ deploy:
branch:
- master
- development

6 changes: 5 additions & 1 deletion src/backend/templates/speakers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@
<span id="session-location" >{{microlocation}}</span>
</strong>
</h5>
<a href="tracks.html#{{session_id}}">
{{#if ../../mode}}
<a href = "sessions/session_{{session_id}}.html">
{{else}}
<a href = "tracks.html#{{session_id}}">
{{/if}}
<h4 style="background-color:{{{color}}}; color:{{{font_color}}}" class="sizeevent event">
<span class="time-track">{{start}} - {{end}}&nbsp;&bull;&nbsp;</span>
<span>{{{title}}}</span>
Expand Down
24 changes: 22 additions & 2 deletions src/selenium/speakerPage.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var BasePage = require('./basePage.js');
var By = require('selenium-webdriver').By;
var until = require('selenium-webdriver').until;

var SpeakerPage = Object.create(BasePage);

SpeakerPage.searchTest = function() {
var idList = ['2330', '2240'];

return this.commonSearchTest('Mario', idList);
};

Expand All @@ -20,7 +20,7 @@ SpeakerPage.jumpToTrack = function() {
elem.findElement(By.className('sessions')).findElement(By.css('a')).click().then(self.getPageUrl.bind(self))
.then(function(url) {
self.driver.executeScript(pageVertScrollOffset).then(function(height) {
resolve(height > 0 && (url.search('tracks') != -1));
resolve(height > 0 && (url.search('tracks') !== -1));
});
});
});
Expand All @@ -29,4 +29,24 @@ SpeakerPage.jumpToTrack = function() {
return trackPromise;
};

SpeakerPage.jumpToSession = function() {
var self = this;
var speakerId = '53';
var pageVertScrollOffset = 'return window.scrollY';

var sessionPromise = new Promise(function(resolve) {
self.find(By.id(speakerId)).then(function(elem) {
self.driver.actions().mouseMove(elem).perform();
elem.findElement(By.className('sessions')).findElement(By.css('a')).click().then(self.getPageUrl.bind(self))
.then(function(url) {
self.driver.executeScript(pageVertScrollOffset).then(function() {
resolve(url.search('session') !== -1);
});
});
});
});

return sessionPromise;
};

module.exports = SpeakerPage;
Loading

0 comments on commit 685c827

Please sign in to comment.