forked from microsoft/playwright-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·32 lines (22 loc) · 750 Bytes
/
test.sh
File metadata and controls
executable file
·32 lines (22 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -e
set +x
trap "cd $(pwd -P)" EXIT
cd "$(dirname $0)"
TMP_DIR=$(mktemp -d)
echo "Created ${TMP_DIR}"
echo "Running CLI..."
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="--version" 2>&1 | tee ${TMP_DIR}/cli.txt
echo "Running TestApp..."
mvn compile exec:java -e -Dexec.mainClass=com.microsoft.playwright.testcliversion.TestApp 2>&1 | tee ${TMP_DIR}/app.txt
CLI_VERSION=$(cat ${TMP_DIR}/cli.txt | tail -n 1 | cut -d\ -f2)
PACKAGE_VERSION=$(cat ${TMP_DIR}/app.txt | grep ImplementationVersion | cut -d\ -f2)
rm -rf $TMP_DIR
echo "Comparing versions: ${CLI_VERSION} and ${PACKAGE_VERSION}"
if [[ "$CLI_VERSION" == "$PACKAGE_VERSION" ]];
then
echo "SUCCESS.";
else
echo "FAIL.";
exit 1;
fi;