Skip to content

Commit

Permalink
TEMP - take screenshots to debug integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjbauer committed Apr 19, 2019
1 parent 53e4d45 commit 79cc1be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions test/frontend-integration-test/helloworld.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,16 @@ describe('deploy helloworld sample run', () => {

// Deploy
$('#startNewRunBtn').click();

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

it('redirects back to all runs page', () => {
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', () => {
Expand Down
20 changes: 12 additions & 8 deletions test/frontend-integration-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ POD=`/src/tools/google-cloud-sdk/bin/kubectl get pods -n ${NAMESPACE} -l app=ml-
./node_modules/.bin/wait-port 127.0.0.1:3000 -t 20000

export PIPELINE_OUTPUT=${RESULTS_GCS_DIR}/pipeline_output

JUNIT_TEST_RESULT=junit_FrontendIntegrationTestOutput.xml

# Don't exit early if 'npm test' fails
TEST_RESULT=`npm test 2>&1`
set +e
npm test
TEST_EXIT_CODE=$?
set -e

# Log the test result
printf '%s\n' "$TEST_RESULT"
# Convert test result to junit.xml
printf '%s\n' "$TEST_RESULT" | go-junit-report > ${JUNIT_TEST_RESULT}
echo 'new-run-screenshot'
base64 'new-run-screenshot.png'
echo \"-----\"

echo 'redirect-screenshot'
base64 'redirect-screenshot.png'
echo \"-----\"

JUNIT_TEST_RESULT=junit_FrontendIntegrationTestOutput.xml

echo "Copy test result to GCS ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}"
tools/google-cloud-sdk/bin/gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}
Expand Down

0 comments on commit 79cc1be

Please sign in to comment.