From 11d62245e91c86ce0d9b04ddb9aec3d41c83d0ce Mon Sep 17 00:00:00 2001 From: Maxim Mordasov Date: Thu, 30 Mar 2023 21:17:58 +0300 Subject: [PATCH] fix safari scroll (#1663) # What this PR does Fix scroll in Safari ## Which issue(s) this PR fixes https://github.com/grafana/oncall/issues/415 ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Joey Orlando Co-authored-by: Joey Orlando --- .github/workflows/linting-and-tests.yml | 6 ++---- CHANGELOG.md | 1 + .../alerts/onCallSchedule.test.ts | 3 +++ .../integration-tests/utils/forms.ts | 2 +- grafana-plugin/playwright.config.ts | 20 +++++++------------ .../src/img/grafanaGlobalStyles.css | 3 ++- .../escalation-chains/EscalationChains.tsx | 7 +------ 7 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/linting-and-tests.yml b/.github/workflows/linting-and-tests.yml index d7b0dcc8..351f698b 100644 --- a/.github/workflows/linting-and-tests.yml +++ b/.github/workflows/linting-and-tests.yml @@ -373,16 +373,14 @@ jobs: uses: actions/cache@v3 with: path: "~/.cache/ms-playwright" - key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} + key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium-firefox-webkit - name: Install Playwright binaries/dependencies if: steps.playwright-cache.outputs.cache-hit != 'true' - # if more browsers are added, will need to modify the "npx playwright install" command # https://stackoverflow.com/questions/65900299/install-single-dependency-from-package-json-with-yarn run: | yarn add "@playwright/test@${{ env.PLAYWRIGHT_VERSION }}" - npx playwright install --with-deps chromium firefox - npx playwright install-deps + npx playwright install --with-deps chromium firefox webkit - name: Await k8s pods and other resources up uses: jupyterhub/action-k8s-await-workloads@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 68569af4..5e1f4c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix team search when filtering resources by @vadimkerr ([#1680](https://github.com/grafana/oncall/pull/1680)) +- Fix issue when trying to scroll in Safari ([#415](https://github.com/grafana/oncall/issues/415)) ## v1.2.6 (2023-03-30) diff --git a/grafana-plugin/integration-tests/alerts/onCallSchedule.test.ts b/grafana-plugin/integration-tests/alerts/onCallSchedule.test.ts index 800faea6..3ba425a9 100644 --- a/grafana-plugin/integration-tests/alerts/onCallSchedule.test.ts +++ b/grafana-plugin/integration-tests/alerts/onCallSchedule.test.ts @@ -6,6 +6,9 @@ import { createIntegrationAndSendDemoAlert } from '../utils/integrations'; import { createOnCallSchedule } from '../utils/schedule'; test('we can create an oncall schedule + receive an alert', async ({ page }) => { + // this test does a lot of stuff, lets give it adequate time to do its thing + test.slow(); + const escalationChainName = generateRandomValue(); const integrationName = generateRandomValue(); const onCallScheduleName = generateRandomValue(); diff --git a/grafana-plugin/integration-tests/utils/forms.ts b/grafana-plugin/integration-tests/utils/forms.ts index 46142e64..10709207 100644 --- a/grafana-plugin/integration-tests/utils/forms.ts +++ b/grafana-plugin/integration-tests/utils/forms.ts @@ -39,7 +39,7 @@ export const clickButton = async ({ dataTestId, }: ClickButtonArgs): Promise => { const baseLocator = dataTestId ? `button[data-testid="${dataTestId}"]` : 'button'; - const button = (startingLocator || page).locator(`${baseLocator} >> text=${buttonText}`); + const button = (startingLocator || page).locator(`${baseLocator}:not([disabled]) >> text=${buttonText}`); await button.waitFor({ state: 'visible' }); await button.click(); diff --git a/grafana-plugin/playwright.config.ts b/grafana-plugin/playwright.config.ts index e1bfa6d8..9084e46a 100644 --- a/grafana-plugin/playwright.config.ts +++ b/grafana-plugin/playwright.config.ts @@ -14,7 +14,6 @@ const config: PlaywrightTestConfig = { testDir: './integration-tests', globalSetup: './integration-tests/globalSetup.ts', /* Maximum time one test can run for. */ - // TODO: set this back to 60 when GSelect component is refactored timeout: 90 * 1000, expect: { /** @@ -28,10 +27,7 @@ const config: PlaywrightTestConfig = { /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ - retries: process.env.CI ? 1 : 0, - // TODO: when GSelect component is refactored, run using 3 workers - // locally use one worker, on CI use 3 - // workers: process.env.CI ? 3 : 1, + retries: process.env.CI ? 3 : 0, workers: 1, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', @@ -64,14 +60,12 @@ const config: PlaywrightTestConfig = { ...devices['Desktop Firefox'], }, }, - - // TODO: enable tests on Safari once the scroll bug when creating an integration is patched - // { - // name: 'webkit', - // use: { - // ...devices['Desktop Safari'], - // }, - // }, + { + name: 'webkit', + use: { + ...devices['Desktop Safari'], + }, + }, /* Test against mobile viewports. */ // { diff --git a/grafana-plugin/src/img/grafanaGlobalStyles.css b/grafana-plugin/src/img/grafanaGlobalStyles.css index 525dd58d..31e4fa5d 100644 --- a/grafana-plugin/src/img/grafanaGlobalStyles.css +++ b/grafana-plugin/src/img/grafanaGlobalStyles.css @@ -1,6 +1,7 @@ /* Navigation/Layout */ -.drawer-content { +.drawer-content, +.rc-drawer-content { overflow: auto !important; /* fix https://github.com/grafana/oncall/issues/415 */ } diff --git a/grafana-plugin/src/pages/escalation-chains/EscalationChains.tsx b/grafana-plugin/src/pages/escalation-chains/EscalationChains.tsx index fd67d695..0b4001dd 100644 --- a/grafana-plugin/src/pages/escalation-chains/EscalationChains.tsx +++ b/grafana-plugin/src/pages/escalation-chains/EscalationChains.tsx @@ -286,12 +286,7 @@ class EscalationChainsPage extends React.Component - + {escalationChain.name}