Skip to content

Commit

Permalink
Move embedding tests to a separate file to avoid contention. (oppia#3594
Browse files Browse the repository at this point in the history
)

* Move embedding tests to a separate file to avoid contention.

* Remove one of the embedding tests.

* Reinstate other Travis tests. Remove some more parts of the embedding e2e test that aren't really needed.
  • Loading branch information
seanlip authored Jul 2, 2017
1 parent 339f85d commit a1cf073
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
- RUN_E2E_TESTS_LIBRARY=true
- RUN_E2E_TESTS_MISC=true
- RUN_E2E_TESTS_USERS=true
- RUN_E2E_TESTS_EMBEDDING=true
- RUN_BACKEND_TESTS=true REPORT_BACKEND_COVERAGE=false
# TODO(sll): Reinstate this when we can get it to run in reasonable time.
# - RUN_BACKEND_TESTS=true REPORT_BACKEND_COVERAGE=true
Expand All @@ -39,6 +40,7 @@ env:
- RUN_E2E_TESTS_LIBRARY_PROD=true
- RUN_E2E_TESTS_MISC_PROD=true
- RUN_E2E_TESTS_USERS_PROD=true
- RUN_E2E_TESTS_EMBEDDING_PROD=true
matrix:
allow_failures: []
fast_finish: true
Expand Down Expand Up @@ -88,6 +90,7 @@ script:
- if [ $RUN_E2E_TESTS_LIBRARY == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="library"; fi
- if [ $RUN_E2E_TESTS_MISC == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="misc"; fi
- if [ $RUN_E2E_TESTS_USERS == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="users"; fi
- if [ $RUN_E2E_TESTS_EMBEDDING == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="embedding"; fi
- if [ $RUN_BACKEND_TESTS == 'true' ] && [ $REPORT_BACKEND_COVERAGE == 'true' ]; then bash scripts/run_backend_tests.sh --generate_coverage_report; fi
- if [ $RUN_BACKEND_TESTS == 'true' ] && [ $REPORT_BACKEND_COVERAGE == 'false' ]; then bash scripts/run_backend_tests.sh; fi
- if [ $RUN_LINT == 'true' ]; then bash scripts/install_third_party.sh; python scripts/pre_commit_linter.py --path=.; fi
Expand All @@ -101,6 +104,7 @@ script:
- if [ $RUN_E2E_TESTS_LIBRARY_PROD == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="library" --prod_env; fi
- if [ $RUN_E2E_TESTS_MISC_PROD == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="misc" --prod_env; fi
- if [ $RUN_E2E_TESTS_USERS_PROD == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="users" --prod_env; fi
- if [ $RUN_E2E_TESTS_EMBEDDING_PROD == 'true' ]; then travis_retry bash scripts/run_e2e_tests.sh --suite="embedding" --prod_env; fi

after_success:
- if [ $RUN_BACKEND_TESTS == 'true' ] && [ $REPORT_BACKEND_COVERAGE == 'true' ]; then codecov; fi
Expand Down
5 changes: 4 additions & 1 deletion core/tests/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ exports.config = {
'protractor/cacheSlugs.js',
'protractor/staticPagesTour.js',
'protractor/collections.js',
'protractor/embedding.js',
'protractor/accessibility.js',
'protractor/i18n.js'
],

embedding: [
'protractor/embedding.js'
]
},

Expand Down
30 changes: 0 additions & 30 deletions core/tests/protractor/embedding.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@ describe('Embedding', function() {
var TEST_PAGES = [{
filename: 'embedding_tests_dev_0.0.1.min.html',
isVersion1: true
}, {
filename: 'embedding_tests_jsdelivr_0.0.1.min.html',
isVersion1: true
}, {
filename: 'embedding_tests_dev_0.0.2.min.html',
isVersion1: false
}];

// The length of time the page waits before confirming an exploration
// cannot be loaded.
var LOADING_TIMEOUT = 10000;

var playCountingExploration = function(version) {
general.waitForSystem();
browser.waitForAngular();
Expand Down Expand Up @@ -103,29 +96,6 @@ describe('Embedding', function() {
by.xpath("//div[@class='protractor-test-old-version']/iframe")));
playCountingExploration(1);
browser.switchTo().defaultContent();

if (TEST_PAGES[i].isVersion1) {
// Tests of failed loading (old version)
var missingIdElement = driver.findElement(
by.xpath("//div[@class='protractor-test-missing-id']/div/span"));
expect(missingIdElement.getText()).toMatch(
'This Oppia exploration could not be loaded because no oppia-id ' +
'attribute was specified in the HTML tag.');
var buttonXPath = '/oppia/div/button';
driver.findElement(
by.xpath(
"//div[@class='protractor-test-invalid-id-deferred']" + buttonXPath
)).click();
browser.sleep(LOADING_TIMEOUT);
expect(
driver.findElement(
by.xpath("//div[@class='protractor-test-invalid-id']/div/div/span")
).getText()).toMatch('This exploration could not be loaded.');
expect(
driver.findElement(
by.xpath("//div[@class='protractor-test-invalid-id']/div/div/span")
).getText()).toMatch('This exploration could not be loaded.');
}
}

// Certain events in the exploration playthroughs should trigger hook
Expand Down

0 comments on commit a1cf073

Please sign in to comment.