Skip to content

Commit

Permalink
Bump up chrome webdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcialRosales committed Sep 3, 2024
1 parent aea39a2 commit 73e7cd4
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 16 deletions.
9 changes: 9 additions & 0 deletions selenium/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
package-lock.json
screens/*/*
logs
suites/logs/*
suites/screens/*
test/oauth/*/h2/*.trace.db
test/oauth/*/h2/*.lock.db
*/target/*
7 changes: 5 additions & 2 deletions selenium/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Automated End-to-End testing of the management ui with Selenium
# Automated End-to-End testing with Mocha and Selenium

Mocha is Javascript test framework running on Node.js and in the browser.
Selenium webdriver is used to drive web browser's interactions on the management ui.
And Mocha is used as the testing framework for Javascript.
Together these two frameworks are used to write and run end-to-end tests in the management ui
and outside of the management ui too, for instance, to test various messaging protocols against
various authentication backend combinations.

The following must be installed to run the tests:
- make
Expand Down
15 changes: 10 additions & 5 deletions selenium/bin/components/rabbitmq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

init_rabbitmq() {
RABBITMQ_CONFIG_DIR=${TEST_CONFIG_DIR}
RABBITMQ_CONFIG_DIR=${TESxT_CONFIG_DIR}
RABBITMQ_DOCKER_IMAGE=${RABBITMQ_DOCKER_IMAGE:-rabbitmq}

print "> RABBITMQ_CONFIG_DIR: ${RABBITMQ_CONFIG_DIR}"
Expand Down Expand Up @@ -30,9 +30,13 @@ stop_rabbitmq() {
kill_container_if_exist "$component"
fi
else
gmake --directory=${RABBITMQ_SERVER_ROOT} stop-node
stop_local_rabbitmq
fi
}
stop_local_rabbitmq() {
RABBITMQ_SERVER_ROOT=$(realpath ../)
gmake --directory=${RABBITMQ_SERVER_ROOT} stop-node
}
save_logs_rabbitmq() {
if [[ "$PROFILES" == *"docker"* ]]; then
if [[ "$PROFILES" == *"cluster"* ]]; then
Expand All @@ -47,7 +51,7 @@ start_local_rabbitmq() {

init_rabbitmq

RABBITMQ_SERVER_ROOT=$(realpath $TEST_DIR/../../../../)
RABBITMQ_SERVER_ROOT=$(realpath ../)
MOUNT_RABBITMQ_CONF="/etc/rabbitmq/rabbitmq.conf"
MOUNT_ADVANCED_CONFIG="/etc/rabbitmq/advanced.config"

Expand All @@ -56,15 +60,16 @@ start_local_rabbitmq() {
print "> EFFECTIVE RABBITMQ_CONFIG_FILE: /tmp$MOUNT_RABBITMQ_CONF"
${BIN_DIR}/gen-advanced-config ${RABBITMQ_CONFIG_DIR} $ENV_FILE /tmp$MOUNT_ADVANCED_CONFIG
RESULT=$?
cp ${RABBITMQ_CONFIG_DIR}/enabled_plugins /tmp/etc/rabbitmq/
if [ $RESULT -eq 0 ]; then
print "> EFFECTIVE RABBITMQ_CONFIG_FILE: /tmp$MOUNT_ADVANCED_CONFIG"
gmake --directory=${RABBITMQ_SERVER_ROOT} run-broker \
RABBITMQ_ENABLED_PLUGINS_FILE=${RABBITMQ_CONFIG_DIR}/enabled_plugins \
RABBITMQ_ENABLED_PLUGINS_FILE=/tmp/etc/rabbitmq/enabled_plugins \
RABBITMQ_CONFIG_FILE=/tmp$MOUNT_RABBITMQ_CONF \
RABBITMQ_ADVANCED_CONFIG_FILE=/tmp$MOUNT_ADVANCED_CONFIG
else
gmake --directory=${RABBITMQ_SERVER_ROOT} run-broker \
RABBITMQ_ENABLED_PLUGINS_FILE=${RABBITMQ_CONFIG_DIR}/enabled_plugins \
RABBITMQ_ENABLED_PLUGINS_FILE=/tmp/etc/rabbitmq/enabled_plugins \
RABBITMQ_CONFIG_FILE=/tmp$MOUNT_RABBITMQ_CONF
fi
print "> RABBITMQ_TEST_DIR: ${RABBITMQ_CONFIG_DIR}"
Expand Down
8 changes: 7 additions & 1 deletion selenium/bin/suite_template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

#set -x
set -x

SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SUITE=$(caller)
Expand Down Expand Up @@ -56,6 +56,9 @@ parse_arguments() {
elif [[ "$1" == "stop-others" ]]
then
echo "stop-others"
elif [[ "$1" == "stop-rabbitmq" ]]
then
echo "stop-rabbitmq"
elif [[ "$1" == "test" ]]
then
echo "test $2"
Expand Down Expand Up @@ -393,6 +396,9 @@ run_local_with() {
if [[ "$COMMAND" == "start-rabbitmq" ]]
then
start_local_rabbitmq
elif [[ "$COMMAND" == "stop-rabbitmq" ]]
then
stop_local_rabbitmq
elif [[ "$COMMAND" == "start-others" ]]
then
start_local_others
Expand Down
2 changes: 1 addition & 1 deletion selenium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"chromedriver": "^125.0.0",
"chromedriver": "^128.0.0",
"ejs": "^3.1.8",
"express": "^4.18.2",
"geckodriver": "^3.0.2",
Expand Down
11 changes: 6 additions & 5 deletions selenium/test/oauth/enabled_plugins
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
rabbitmq_auth_backend_oauth2,rabbitmq_auth_mechanism_ssl,rabbitmq_aws,
rabbitmq_consistent_hash_exchange,rabbitmq_event_exchange,
rabbitmq_federation,rabbitmq_federation_management,
rabbitmq_jms_topic_exchange,rabbitmq_management,rabbitmq_management_agent,
rabbitmq_mqtt,rabbitmq_peer_discovery_aws,rabbitmq_peer_discovery_common,
rabbitmq_federation_prometheus,rabbitmq_jms_topic_exchange,
rabbitmq_management,rabbitmq_management_agent,rabbitmq_mqtt,
rabbitmq_peer_discovery_aws,rabbitmq_peer_discovery_common,
rabbitmq_peer_discovery_consul,rabbitmq_peer_discovery_etcd,
rabbitmq_peer_discovery_k8s,rabbitmq_prometheus,rabbitmq_random_exchange,
rabbitmq_recent_history_exchange,rabbitmq_sharding,rabbitmq_shovel,
rabbitmq_shovel_management,rabbitmq_stomp,rabbitmq_stream,
rabbitmq_stream_common,rabbitmq_stream_management,rabbitmq_top,
rabbitmq_tracing,rabbitmq_trust_store,rabbitmq_web_dispatch,
rabbitmq_shovel_management,rabbitmq_shovel_prometheus,rabbitmq_stomp,
rabbitmq_stream,rabbitmq_stream_common,rabbitmq_stream_management,
rabbitmq_top,rabbitmq_tracing,rabbitmq_trust_store,rabbitmq_web_dispatch,
rabbitmq_web_mqtt,rabbitmq_web_mqtt_examples,rabbitmq_web_stomp,
rabbitmq_web_stomp_examples].
2 changes: 1 addition & 1 deletion selenium/test/oauth/env.local
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export OAUTH_SERVER_CONFIG_BASEDIR=deps/rabbitmq_management/selenium/test
export OAUTH_SERVER_CONFIG_BASEDIR=selenium/test
12 changes: 11 additions & 1 deletion selenium/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,18 @@ module.exports = {
if (!runLocal) {
builder = builder.usingServer(seleniumUrl)
}
var chromeCapabilities = Capabilities.chrome();
//
let chromeCapabilities = Capabilities.chrome();
chromeCapabilities.setAcceptInsecureCerts(true);
var chromeOptions = {
'args': ['--test-type', '--disable-search-engine-choice-screen']
};
chromeCapabilities.set('goog:chromeOptions', {
args: [
"--lang=en",
"--disable-search-engine-choice-screen"
]
});
driver = builder
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
Expand Down

0 comments on commit 73e7cd4

Please sign in to comment.