Skip to content

Commit

Permalink
Store screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjbauer committed Apr 19, 2019
1 parent 79cc1be commit 70c67dd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
11 changes: 6 additions & 5 deletions test/frontend-integration-test/helloworld.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ describe('deploy helloworld sample run', () => {
});

it('redirects back to all runs page', () => {
browser.saveScreenshot('./redirect-screenshot.png');

browser.waitUntil(() => {
return (new URL(browser.getUrl())).hash === '#/runs';
}, waitTimeout, `URL was: ${new URL(browser.getUrl())}`);

browser.saveScreenshot('./redirect-screenshot.png');
});

it('displays both runs in all runs page', () => {
let attempts = 30;

// Wait for a reasonable amount of time until the run starts
while (attempts && $$('.tableRow').length !== 2) {
browser.pause(1000);
Expand All @@ -243,10 +243,11 @@ describe('deploy helloworld sample run', () => {
}
--attempts;
}

browser.saveScreenshot('./table-screenshot.png');

assert(attempts, `waited for 30 seconds but table had ${$$('.tableRow').length} entries. URL was: ${browser.getUrl()}`);
});

it('navigates back to the experiment list', () => {
$('button=Experiments').click();
browser.waitUntil(() => {
Expand Down
20 changes: 17 additions & 3 deletions test/frontend-integration-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,30 @@ export PIPELINE_OUTPUT=${RESULTS_GCS_DIR}/pipeline_output
set +e
npm test
TEST_EXIT_CODE=$?
set -e


NEW_RUN_SCREENSHOT=new-run-screenshot.png
REDIRECT_SCREENSHOT=redirect-screenshot.png
TABLE_SCREENSHOT=table-screenshot.png

echo 'new-run-screenshot'
base64 'new-run-screenshot.png'
base64 ${NEW_RUN_SCREENSHOT}
echo \"-----\"

echo 'redirect-screenshot'
base64 'redirect-screenshot.png'
base64 ${REDIRECT_SCREENSHOT}
echo \"-----\"

echo 'table-screenshot'
base64 ${TABLE_SCREENSHOT}
echo \"-----\"

tools/google-cloud-sdk/bin/gsutil cp ${NEW_RUN_SCREENSHOT} ${RESULTS_GCS_DIR}/${NEW_RUN_SCREENSHOT}
tools/google-cloud-sdk/bin/gsutil cp ${REDIRECT_SCREENSHOT} ${RESULTS_GCS_DIR}/${REDIRECT_SCREENSHOT}
tools/google-cloud-sdk/bin/gsutil cp ${TABLE_SCREENSHOT} ${RESULTS_GCS_DIR}/${TABLE_SCREENSHOT}

set -e

JUNIT_TEST_RESULT=junit_FrontendIntegrationTestOutput.xml

echo "Copy test result to GCS ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}"
Expand Down

0 comments on commit 70c67dd

Please sign in to comment.