Compare commits
16 Commits
main
...
test/googl
Author | SHA1 | Date |
---|---|---|
Shivam Kalra | 16ff63fa4f | |
Shivam Kalra | d5899bca46 | |
Shivam Kalra | 528e335127 | |
Shivam Kalra | a8f5dea40c | |
Shivam Kalra | 90ba62c110 | |
Leo Giovanetti | bfa098741e | |
Shivam Kalra | 65462fcfce | |
Shivam Kalra | 3d3c8dd4c0 | |
Shivam Kalra | 4b9e8d184a | |
Shivam Kalra | ba7c1ac9e4 | |
Shivam Kalra | 58c4ccd5dc | |
Shivam Kalra | d0bf8a63ab | |
Shivam Kalra | 3d4370cb46 | |
Shivam Kalra | 62045f5e8b | |
Wesley Matos | 90e3ac5e46 | |
Wesley Matos | a5a75a26f2 |
|
@ -230,6 +230,13 @@ AUTH_BEARER_TOKEN_VERCEL=
|
||||||
E2E_TEST_APPLE_CALENDAR_EMAIL=""
|
E2E_TEST_APPLE_CALENDAR_EMAIL=""
|
||||||
E2E_TEST_APPLE_CALENDAR_PASSWORD=""
|
E2E_TEST_APPLE_CALENDAR_PASSWORD=""
|
||||||
|
|
||||||
|
# - GOOGLE CALENDAR
|
||||||
|
# Used for E2E tests on Google Calendar
|
||||||
|
E2E_TEST_GOOGLE_CALENDAR_EMAIL=""
|
||||||
|
E2E_TEST_GOOGLE_CALENDAR_PASSWORD=""
|
||||||
|
E2E_TEST_GOOGLE_AUTH_CONSENT_APPNAME=""
|
||||||
|
|
||||||
|
|
||||||
# - APP CREDENTIAL SYNC ***********************************************************************************
|
# - APP CREDENTIAL SYNC ***********************************************************************************
|
||||||
# Used for self-hosters that are implementing Cal.com into their applications that already have certain integrations
|
# Used for self-hosters that are implementing Cal.com into their applications that already have certain integrations
|
||||||
# Under settings/admin/apps ensure that all app secrets are set the same as the parent application
|
# Under settings/admin/apps ensure that all app secrets are set the same as the parent application
|
||||||
|
|
|
@ -42,6 +42,9 @@ jobs:
|
||||||
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
|
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
|
||||||
E2E_TEST_APPLE_CALENDAR_EMAIL: ${{ secrets.E2E_TEST_APPLE_CALENDAR_EMAIL }}
|
E2E_TEST_APPLE_CALENDAR_EMAIL: ${{ secrets.E2E_TEST_APPLE_CALENDAR_EMAIL }}
|
||||||
E2E_TEST_APPLE_CALENDAR_PASSWORD: ${{ secrets.E2E_TEST_APPLE_CALENDAR_PASSWORD }}
|
E2E_TEST_APPLE_CALENDAR_PASSWORD: ${{ secrets.E2E_TEST_APPLE_CALENDAR_PASSWORD }}
|
||||||
|
E2E_TEST_GOOGLE_AUTH_CONSENT_APPNAME: ${{ secrets.E2E_TEST_GOOGLE_AUTH_CONSENT_APPNAME }}
|
||||||
|
E2E_TEST_GOOGLE_CALENDAR_EMAIL: ${{ secrets.E2E_TEST_GOOGLE_CALENDAR_EMAIL }}
|
||||||
|
E2E_TEST_GOOGLE_CALENDAR_PASSWORD: ${{ secrets.E2E_TEST_GOOGLE_CALENDAR_PASSWORD }}
|
||||||
E2E_TEST_MAILHOG_ENABLED: ${{ vars.E2E_TEST_MAILHOG_ENABLED }}
|
E2E_TEST_MAILHOG_ENABLED: ${{ vars.E2E_TEST_MAILHOG_ENABLED }}
|
||||||
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
|
GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
|
||||||
EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
|
EMAIL_SERVER_HOST: ${{ secrets.CI_EMAIL_SERVER_HOST }}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||||
|
import { expect } from "@playwright/test";
|
||||||
|
|
||||||
|
import { IS_PRODUCTION, IS_SELF_HOSTED } from "@calcom/lib/constants";
|
||||||
|
|
||||||
|
import { test } from "./lib/fixtures";
|
||||||
|
import { installGoogleCalendar } from "./lib/testUtils";
|
||||||
|
|
||||||
|
test.describe.configure({ mode: "parallel" });
|
||||||
|
|
||||||
|
const GOOGLE_CALENDAR_EMAIL = process.env.E2E_TEST_GOOGLE_CALENDAR_EMAIL!;
|
||||||
|
const GOOGLE_CALENDAR_PASSWORD = process.env.E2E_TEST_GOOGLE_CALENDAR_PASSWORD!;
|
||||||
|
const GOOGLE_APPNAME = process.env.E2E_TEST_GOOGLE_AUTH_CONSENT_APPNAME!;
|
||||||
|
|
||||||
|
const SHOULD_FAIL_TESTS = !GOOGLE_CALENDAR_EMAIL || !GOOGLE_CALENDAR_PASSWORD || !GOOGLE_APPNAME;
|
||||||
|
|
||||||
|
test.afterEach(async ({ users, page }) => {
|
||||||
|
await page.goto("https://myaccount.google.com/connections?filters=2");
|
||||||
|
await page.locator(`a:has-text("${GOOGLE_APPNAME}")`).click();
|
||||||
|
await page.locator(`div[data-name="${GOOGLE_APPNAME}"][role="button"]`).click();
|
||||||
|
await page.getByRole("button", { name: "Confirm" }).click();
|
||||||
|
await users.deleteAll();
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe("Google Calendar", () => {
|
||||||
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
|
test.skip(IS_SELF_HOSTED && IS_PRODUCTION, "Skipping for Self Hosted in Production");
|
||||||
|
expect(SHOULD_FAIL_TESTS).toBeFalsy();
|
||||||
|
|
||||||
|
test("Should be able to install and login on Google Calendar", async ({ page, users }) => {
|
||||||
|
const user = await users.create();
|
||||||
|
await user.apiLogin();
|
||||||
|
|
||||||
|
await installGoogleCalendar(page);
|
||||||
|
|
||||||
|
// wait for https://accounts.google.com
|
||||||
|
await page.waitForURL((url) => url.hostname === "accounts.google.com");
|
||||||
|
|
||||||
|
await page.waitForSelector('input[type="email"]');
|
||||||
|
await page.type('input[type="email"]', GOOGLE_CALENDAR_EMAIL);
|
||||||
|
await page.click("#identifierNext");
|
||||||
|
|
||||||
|
// password page
|
||||||
|
await page.waitForSelector('#password input[type="password"]');
|
||||||
|
await page.type('#password input[type="password"]', GOOGLE_CALENDAR_PASSWORD);
|
||||||
|
await page.click("#passwordNext");
|
||||||
|
|
||||||
|
// this is needed because I have an test app that is not verified by Google
|
||||||
|
// await page.waitForURL(/\/warning/);
|
||||||
|
|
||||||
|
await page.waitForURL((url) => url.pathname.includes("/warning"));
|
||||||
|
await page.getByRole("button", { name: "Continue" }).click();
|
||||||
|
|
||||||
|
await page.waitForSelector("#submit_approve_access");
|
||||||
|
|
||||||
|
// allowing all permissions that our app requests
|
||||||
|
await page.getByText("Select all").click();
|
||||||
|
await page.click("#submit_approve_access");
|
||||||
|
|
||||||
|
await page.waitForURL("apps/installed/calendar?category=calendar");
|
||||||
|
|
||||||
|
await expect(page.locator(`label[for="${GOOGLE_CALENDAR_EMAIL}"]`)).toBeVisible();
|
||||||
|
});
|
||||||
|
});
|
|
@ -197,6 +197,13 @@ export async function installAppleCalendar(page: Page) {
|
||||||
await page.click('[data-testid="install-app-button"]');
|
await page.click('[data-testid="install-app-button"]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function installGoogleCalendar(page: Page) {
|
||||||
|
await page.goto("/apps/categories/calendar");
|
||||||
|
await page.click('[data-testid="app-store-app-card-google-calendar"]');
|
||||||
|
await page.waitForURL("/apps/google-calendar");
|
||||||
|
await page.click('[data-testid="install-app-button"]');
|
||||||
|
}
|
||||||
|
|
||||||
export async function getEmailsReceivedByUser({
|
export async function getEmailsReceivedByUser({
|
||||||
emails,
|
emails,
|
||||||
userEmail,
|
userEmail,
|
||||||
|
|
|
@ -216,6 +216,9 @@
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
"E2E_TEST_APPLE_CALENDAR_EMAIL",
|
"E2E_TEST_APPLE_CALENDAR_EMAIL",
|
||||||
"E2E_TEST_APPLE_CALENDAR_PASSWORD",
|
"E2E_TEST_APPLE_CALENDAR_PASSWORD",
|
||||||
|
"E2E_TEST_GOOGLE_AUTH_CONSENT_APPNAME",
|
||||||
|
"E2E_TEST_GOOGLE_CALENDAR_EMAIL",
|
||||||
|
"E2E_TEST_GOOGLE_CALENDAR_PASSWORD",
|
||||||
"E2E_TEST_MAILHOG_ENABLED",
|
"E2E_TEST_MAILHOG_ENABLED",
|
||||||
"E2E_TEST_OIDC_CLIENT_ID",
|
"E2E_TEST_OIDC_CLIENT_ID",
|
||||||
"E2E_TEST_OIDC_CLIENT_SECRET",
|
"E2E_TEST_OIDC_CLIENT_SECRET",
|
||||||
|
|
Loading…
Reference in New Issue