<commit_before>#!/bin/bash -e
##-------------------------------------------------------------------
## File : selenium_gui_test.sh
## Author : Denny <<EMAIL>>
## Description :
## --
## Created : <2017-05-18>
## Updated: Time-stamp: <2017-06-07 18:27:36>
##-------------------------------------------------------------------
url_test=${1?}
bind_hosts_list=${2:-""}
test_py_script=${3:="/home/seluser/scripts/selenium_load_page.py"}
maximum_seconds=${4:-"30"}
container_name=${5:-"selelinum"}

working_dir="/root/selenium_test"
[ -d "$working_dir" ] || mkdir -p "$working_dir"

# Start docker container
# TODO: better implementation
if docker ps -a | grep "$container_name"; then
    docker stop "$container_name"; docker rm "$container_name"
fi

# Destroy docker container
docker exec selenium python "$test_py_script" \
       --page_url "$url_test"  --max_load_seconds $maximum_seconds
################################################################################
## File : selenium_gui_test.sh ends<commit_msg>shellcheck fix<commit_after>#!/bin/bash -e
##-------------------------------------------------------------------
## File : selenium_gui_test.sh
## Author : Denny <<EMAIL>>
## Description :
## --
## Created : <2017-05-18>
## Updated: Time-stamp: <2017-06-07 19:59:55>
##-------------------------------------------------------------------
url_test=${1?}
bind_hosts_list=${2:-""}
test_py_script=${3:="/home/seluser/scripts/selenium_load_page.py"}
maximum_seconds=${4:-"30"}
container_name=${5:-"selelinum"}

working_dir="/root/selenium_test"
[ -d "$working_dir" ] || mkdir -p "$working_dir"

# Start docker container
# TODO: better implementation
if docker ps -a | grep "$container_name"; then
    docker stop "$container_name"; docker rm "$container_name"
fi

if [ -n "$bind_hosts_list" ]; then
   echo "TODO: update hosts"
fi

# Destroy docker container
docker exec selenium python "$test_py_script" \
       --page_url "$url_test"  --max_load_seconds "$maximum_seconds"
################################################################################
## File : selenium_gui_test.sh ends
{'fraction_non_alphanumeric': 0.3426939552594003, 'fraction_numerical': 0.02760590195145169, 'mean_word_length': 2.878228782287823, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425807', 'n_tokens_mistral': 674, 'n_tokens_neox': 598, 'n_words': 129}