Skip to content

Commit

Permalink
Update funtional tests (#3030)
Browse files Browse the repository at this point in the history
Update functional tests
  • Loading branch information
bbert authored and epiclabsDASH committed Jul 19, 2019
1 parent 36bb011 commit 3549b41
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- run:
# Run functional tests
name: Run functional tests
command: node node_modules/intern/runner.js config=test/functional/config.js selenium=remote app=remote
command: node node_modules/intern/runner.js config=test/functional/config.js selenium=remote app=remote browsers=chrome

workflows:
version: 2
Expand Down
21 changes: 13 additions & 8 deletions test/functional/config/browsers/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,32 @@ define(function () {
browserName: 'chrome',
platform: 'WINDOWS',
os: 'WINDOWS',
os_version: '10'
os_version: '10',
keySystems: ['com.widevine.alpha', 'org.w3.clearkey'],
'goog:chromeOptions': { w3c: false }
};

var EDGE_CONFIG = {
browserName: 'MicrosoftEdge',
platform: 'WINDOWS'
};
var FIREFOX_CONFIG = {
browserName: 'firefox',
platform: 'WINDOWS',
os: 'WINDOWS',
os_version: '10'
os_version: '10',
keySystems: ['com.widevine.alpha', 'org.w3.clearkey']
};

var EDGE_CONFIG = {
browserName: 'MicrosoftEdge',
platform: 'WINDOWS',
keySystems: ['com.microsoft.playready', 'org.w3.clearkey']
};

return {
all: [CHROME_CONFIG, EDGE_CONFIG, FIREFOX_CONFIG],

chrome: [CHROME_CONFIG],

edge: [EDGE_CONFIG],
firefox: [FIREFOX_CONFIG],

firefox: [FIREFOX_CONFIG]
edge: [EDGE_CONFIG]
};
});
6 changes: 4 additions & 2 deletions test/functional/config/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ define([

// Filter streams if input stream name is set
if (intern.config.testStream) {
streams = streams.filter(stream => stream.name.indexOf(intern.config.testStream) !== -1);
}
streams = streams.filter(stream => {
return stream.name.indexOf(intern.config.testStream) !== -1;
});
};

// streams = streams.slice(0, 1);

Expand Down
Binary file modified test/functional/selenium/chromedriver.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion test/functional/tests/seek.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([
var PROGRESS_VALUE = 5; // Playback progress value (in sec.) to be checked
var PROGRESS_TIMEOUT = 10; // Timeout (in sec.) for checking playback progress
var SEEK_TIMEOUT = 10; // Timeout (in sec.) for checking seek to be completed
var DURATION_TOLERANCE = 3; // Tolerance (in sec.) for duration difference between manifest and media
var SEEK_COUNT = 3; // Number of seek tests

// Test variables
Expand Down Expand Up @@ -80,7 +81,7 @@ define([
.then(function(duration) {
utils.log(NAME, 'Duration: ' + duration);
// Generate randomly a seek position
seekPos = generateSeekPos(duration);
seekPos = generateSeekPos(duration - DURATION_TOLERANCE);
utils.log(NAME, 'Seek: ' + seekPos);
// Seek the player
return command.executeAsync(player.seek, [seekPos, SEEK_TIMEOUT]);
Expand Down
18 changes: 17 additions & 1 deletion test/functional/tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ SETUP:
- check if stream is available
**/
define([
'intern',
'intern!object',
'intern/chai!assert',
'test/functional/tests/scripts/utils'
], function(registerSuite, assert, utils) {
], function(intern, registerSuite, assert, utils) {

// Suite name
var NAME = 'SETUP';
Expand All @@ -18,6 +19,21 @@ define([

setup: function () {
utils.info(NAME, 'Setup stream: ' + stream.name);

// Check key systems support
var browserName = this.remote.session.capabilities.browserName;
var browsersConf = intern.config.environments.filter(conf => conf.browserName === browserName)[0];

if (stream.protData) {
stream.available = false;
Object.keys(stream.protData).forEach(keySystem => {
stream.available |= browsersConf.keySystems.includes(keySystem);
});
if (!stream.available) {
this.skip();
}
}

// Check stream availability
return this.remote.executeAsync(utils.checkIfFileExits, [stream.url])
.then(function (exists) {
Expand Down

0 comments on commit 3549b41

Please sign in to comment.