From b5fd1f481d05f37d312cad3667bfc70cea236d47 Mon Sep 17 00:00:00 2001 From: abasha1234 Date: Thu, 4 Jan 2024 14:37:26 +0530 Subject: [PATCH] feat: Add synthetic monitor task for onboarding e2e repo --- .../onboarding/roles/configure/tasks/main.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/deploy/onboarding/roles/configure/tasks/main.yml diff --git a/test/deploy/onboarding/roles/configure/tasks/main.yml b/test/deploy/onboarding/roles/configure/tasks/main.yml new file mode 100644 index 000000000..c3c8bf45f --- /dev/null +++ b/test/deploy/onboarding/roles/configure/tasks/main.yml @@ -0,0 +1,36 @@ +--- +- debug: + msg: Tests E2E + +- name: Clone the Onboarding tests repository + git: + repo: https://github.com/newrelic/onboarding-e2e-tests.git + dest: /opt/onboarding-e2e-tests + +- name: Write Permissions for repo + shell: "mkdir -p /opt/onboarding-e2e-tests && chmod 755 /opt/onboarding-e2e-tests" + +- name: Trigger Onboarding tests + shell: "cd /opt/onboarding-e2e-tests && pwd" + +- name: Create env file + shell: "touch /opt/onboarding-e2e-tests/.env" + +- name: Store values in env file + shell: | + echo "ENV_SECRET_EMAIL='example@newrelic.com' \nENV_SECRET_PASSWORD='example'" >> /opt/onboarding-e2e-tests/.env + +- name: npm install + shell: "npm install" + args: + chdir: /opt/onboarding-e2e-tests + +- name: Install Playwright + shell: "npx playwright@1.32.0 install --with-deps chromium" + args: + chdir: /opt/onboarding-e2e-tests + +- name: Test playwright scripts + shell: "npx playwright test" + args: + chdir: /opt/onboarding-e2e-tests