Commit 6d760a60 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Some improvements over robot framework docker image

parent efc75241
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@ CAPIF_VAULT_PORT=8200
# CAPIF_VAULT_TOKEN=dev-only-token
CAPIF_VAULT_TOKEN=read-ca-token

MOCK_SERVER_URL=http://192.168.0.119:9090

MOCK_SERVER_URL=http://192.168.0.11:9090


echo "CAPIF_HOSTNAME = $CAPIF_HOSTNAME"
+6 −26
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ ${CAPIF_CALLBACK_PORT} 8086
${REGISTER_ADMIN_USER}          admin
${REGISTER_ADMIN_PASSWORD}      password123

${MOCK_SERVER_URL}               http://192.168.0.14:9090
${MOCK_SERVER_URL}


${DISCOVER_URL}                 /service-apis/v1/allServiceAPIs?api-invoker-id=
@@ -91,33 +91,13 @@ Test ${TEST NAME} Currently Not Supported
    Log    Test "${TEST NAME}" Currently not supported    WARN
    Skip    Test "${TEST NAME}" Currently not supported

Start Mock server
    Log  Starting mock Server for Robot Framework.

    # Run Process      pip3 install -r /opt/robot-tests/tests/libraries/mock_server/requirements.txt
    ${server_process}=     Start Process    python3  /opt/robot-tests/tests/libraries/mock_server/mock_server.py   shell=True
    # Log	  PID: ${server_process.pid}
    Log   output: ${server_process.stdout}
    
    Sleep    5m
    Create Session    mockserver    ${MOCK_SERVER_URL}

    ${endpoint}=    Set Variable  /testing

    ${json}=    Create Dictionary      events="SERVICE_API_INVOCATION_SUCCESS"       subscriptionId="255545008cd3937f5554a3651bbfb9"

    ${resp}=    POST On Session
    ...    mockserver
    ...    ${endpoint}
    ...    json=${json}
    ...    expected_status=any
    ...    verify=False

    ${result}=	 Terminate Process  ${server_process}

Check Mock Server
    Log  Checking mock Server for Robot Framework.

    IF    "${MOCK_SERVER_URL}" == ""
        Fail   Mock Server Url is not setup on Tests execution, check MOCK_SERVER_URL variable   mockserver-not-ready
    END

    Create Session    mockserver    ${MOCK_SERVER_URL}

    ${endpoint}=    Set Variable  /requests_list
@@ -128,7 +108,7 @@ Check Mock Server
    ...    expected_status=any
    ...    verify=False

    Status Should Be    200    ${resp}
    Status Should Be    200    ${resp}   Mock Server response is not 200 OK at ${MOCK_SERVER_URL}, check server status.

Clean Mock Server
    Log  Checking mock Server for Robot Framework.
+0 −12
Original line number Diff line number Diff line
@@ -64,18 +64,6 @@ RUN python3.10 -m venv /opt/venv

ENV PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers

# Instalación de nvm y node a la última versión
# RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# # RUN source /root/.bashrc
# # RUN export NVM_DIR="$HOME/.nvm" \
# #     [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm \
# #     [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 

# RUN nvm install node
# # RUN npx playwright install
# RUN yes|npx playwright install-deps


ADD basicRequirements.txt /root/

ADD basicRobotInstall.sh /root/
+0 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ requests==2.28.1
rfc3987==1.3.8
robotframework==7.0
robotframework-archivelibrary == 0.4.2
robotframework-browser==18.3.0
robotframework-httpctrl==0.3.1
robotframework-lint==1.1
robotframework-mongodb-library==3.2
+1 −9
Original line number Diff line number Diff line
#!/bin/bash
echo "Installing basic software related with robotFramework"
source /opt/venv/bin/activate; 
source /opt/venv/bin/activate
pip install --upgrade pip
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source /root/.bashrc
nvm install node
yes|npx playwright install-deps
pip install -r $1
rfbrowser clean-node
rfbrowser init --skip-browsers
npx playwright install
npx playwright install-deps
echo "Robot framework installed"