Skip to content

Commit

Permalink
use providers list from FACTORY_TEST_CONSTANTS
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey committed Jan 15, 2024
1 parent 1fa7c9f commit 20a1ae7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 7 additions & 15 deletions tests/e2e/pageobjects/dashboard/UserPreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ import { CLASSES } from '../../configs/inversify.types';
import { By } from 'selenium-webdriver';
import { DriverHelper } from '../../utils/DriverHelper';
import { Logger } from '../../utils/Logger';

enum GitServices {
GITHUB = 'github',
GITLAB = 'gitlab',
BITBUCKET_SERVER_OAUTH1 = 'bitbucket-server-oauth1',
BITBUCKET_SERVER_OAUTH2 = 'bitbucket-server-oauth2',
BITBUCKET_CLOUD_OAUTH2 = 'bitbucket-org',
AZURE_DEVOPS = 'azure-devops'
}
import { GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';

@injectable()
export class UserPreferences {
Expand Down Expand Up @@ -122,12 +114,12 @@ export class UserPreferences {

getServiceConfig(service: string): string {
const gitService: { [key: string]: string } = {
[GitServices.GITHUB]: 'GitHub',
[GitServices.GITLAB]: 'GitLab',
[GitServices.AZURE_DEVOPS]: 'Microsoft Azure DevOps',
[GitServices.BITBUCKET_CLOUD_OAUTH2]: 'Bitbucket Cloud',
[GitServices.BITBUCKET_SERVER_OAUTH1]: 'Bitbucket Server',
[GitServices.BITBUCKET_SERVER_OAUTH2]: 'Bitbucket Server'
[GitProviderType.GITHUB]: 'GitHub',
[GitProviderType.GITLAB]: 'GitLab',
[GitProviderType.AZURE_DEVOPS]: 'Microsoft Azure DevOps',
[GitProviderType.BITBUCKET_CLOUD_OAUTH2]: 'Bitbucket Cloud',
[GitProviderType.BITBUCKET_SERVER_OAUTH1]: 'Bitbucket Server',
[GitProviderType.BITBUCKET_SERVER_OAUTH2]: 'Bitbucket Server'
};

return gitService[service];
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/specs/miscellaneous/RevokeOauth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ suite('"Revoke OAuth" test', function (): void {

test('Revoke OAuth test', async function (): Promise<void> {
await userPreferences.openUserPreferencesPage();
await userPreferences.checkTabsAvailability();

await userPreferences.openGitServicesTab();

const selectedService: string = userPreferences.getServiceConfig(gitService);
Expand Down

0 comments on commit 20a1ae7

Please sign in to comment.