Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing success message when uploading to gitea to prevent flaky test in Playwright #12230

Merged
1 commit merged into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { useQueryClient } from '@tanstack/react-query';
import { useRepoCommitAndPushMutation } from 'app-shared/hooks/mutations';
import * as testids from '../../../../../../testing/testids';
import { toast } from 'react-toastify';

const initialModalState = {
header: '',
Expand Down Expand Up @@ -188,12 +189,9 @@ export const VersionControlButtons = ({ hasPushRight, org, app }: IVersionContro

const { data: result } = await fetchPullData();
if (result.repositoryStatus === 'Ok') {
setModalState({
...initialModalState,
header: t('sync_header.sharing_changes_completed'),
descriptionText: [t('sync_header.sharing_changes_completed_submessage')],
shouldShowDoneIcon: true,
});
setModalState(initialModalState);
setSyncModalAnchorEl(null);
toast.success(t('sync_header.sharing_changes_completed'));
} else if (
result.repositoryStatus === 'MergeConflict' ||
result.repositoryStatus === 'CheckoutConflict'
Expand Down
4 changes: 0 additions & 4 deletions frontend/testing/playwright/components/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ export class Header extends BasePage {
.isVisible();
}

public async closeSuccessMessageBox(): Promise<void> {
await this.page.keyboard.press('Escape');
}

public async clickOnLocalChangesButton(): Promise<void> {
await this.page
.getByRole('button', { name: this.textMock('sync_header.local_changes') })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ test('That new changes are pushed to gitea and are visible on Gitea after they h
await header.clickOnUploadLocalChangesButton();
await header.clickOnValidateChanges();
await header.checkThatUploadSuccessMessageIsVisible();
await header.closeSuccessMessageBox();

await goToGiteaAndNavigateToUiLayoutFiles(header, giteaPage);
await giteaPage.verifyThatTheNewPageIsPresent(newPageName);
Expand Down
Loading