Skip to content

Commit

Permalink
update GitServices list
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey committed Jan 15, 2024
1 parent 02c74bb commit c6d66af
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 36 deletions.
18 changes: 9 additions & 9 deletions tests/e2e/configs/mocharc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ module.exports = {
BASE_TEST_CONSTANTS.TEST_ENVIRONMENT !== ''
? `dist/suites/${MOCHA_CONSTANTS.MOCHA_DIRECTORY}/${MOCHA_CONSTANTS.MOCHA_SUITE}.suite.js`
: // variable MOCHA_DIRECTORY uses in command "test-all-devfiles" and sets up automatically.
// you can set it up to run files from specific directory with export environmental variable.
MOCHA_CONSTANTS.MOCHA_DIRECTORY
? // to run one file (name without extension). uses in "test", "test-all-devfiles".
MOCHA_CONSTANTS.MOCHA_USERSTORY
? `dist/specs/${MOCHA_CONSTANTS.MOCHA_DIRECTORY}/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`
: `dist/specs/${MOCHA_CONSTANTS.MOCHA_DIRECTORY}/**.spec.js`
: MOCHA_CONSTANTS.MOCHA_USERSTORY
? [`dist/specs/**/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`, `dist/specs/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`]
: ['dist/specs/**/**.spec.js', 'dist/specs/**.spec.js'],
// you can set it up to run files from specific directory with export environmental variable.
MOCHA_CONSTANTS.MOCHA_DIRECTORY
? // to run one file (name without extension). uses in "test", "test-all-devfiles".
MOCHA_CONSTANTS.MOCHA_USERSTORY
? `dist/specs/${MOCHA_CONSTANTS.MOCHA_DIRECTORY}/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`
: `dist/specs/${MOCHA_CONSTANTS.MOCHA_DIRECTORY}/**.spec.js`
: MOCHA_CONSTANTS.MOCHA_USERSTORY
? [`dist/specs/**/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`, `dist/specs/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`]
: ['dist/specs/**/**.spec.js', 'dist/specs/**.spec.js'],
retries: MOCHA_CONSTANTS.MOCHA_RETRIES,
grep: MOCHA_CONSTANTS.MOCHA_GREP
};
4 changes: 2 additions & 2 deletions tests/e2e/constants/BASE_TEST_CONSTANTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export const BASE_TEST_CONSTANTS: {
return BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('devspaces')
? 'devspaces'
: BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('che')
? 'che'
: 'default';
? 'che'
: 'default';
},
/**
* testing application version
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/constants/PLUGIN_TEST_CONSTANTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ export const PLUGIN_TEST_CONSTANTS: { TS_SAMPLE_LIST: string } = {
* dashboard samples to check in RecommendedExtensions.spec.ts
*/
TS_SAMPLE_LIST:
process.env.TS_SAMPLE_LIST ||
'Node.js MongoDB,Node.js Express,Java Lombok,Quarkus REST API,Python,.NET,C/C++,Go,PHP,Ansible'
process.env.TS_SAMPLE_LIST || 'Node.js MongoDB,Node.js Express,Java Lombok,Quarkus REST API,Python,.NET,C/C++,Go,PHP,Ansible'
};
32 changes: 17 additions & 15 deletions tests/e2e/pageobjects/dashboard/UserPreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import { By } from 'selenium-webdriver';
import { DriverHelper } from '../../utils/DriverHelper';
import { Logger } from '../../utils/Logger';

enum GitService {
github = 'github',
gitlab='gitlab',
'azure-devops'='azure-devops',
'bitbucket-server-oauth1'='bitbucket-server-oauth1',
'bitbucket-server-oauth2'='bitbucket-server-oauth2'
}
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'
}

@injectable()
export class UserPreferences {
Expand Down Expand Up @@ -119,15 +120,16 @@ export class UserPreferences {
await this.driverHelper.waitVisibility(UserPreferences.ADD_NEW_SSH_KEY_BUTTON);
}

async getServiceConfig(service: string): Promise<string> {
const gitService: { [key: string]: string } = {
[GitService.github]: 'GitHub',
[GitService.gitlab]: 'GitLab',
[GitService['azure-devops']]: 'Microsoft Azure DevOps',
[GitService['bitbucket-server-oauth1']]: 'Bitbucket Server',
[GitService['bitbucket-server-oauth2']]: 'Bitbucket Server'
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'
};

return gitService[service];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/MochaHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function registerRunningWorkspace(workspaceName: string): void {
: ((): void => {
Logger.debug('delete workspace name');
WorkspaceHandlingTests.clearWorkspaceName();
})();
})();

latestWorkspace = workspaceName;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/specs/miscellaneous/RevokeOauth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LoginTests } from '../../tests-library/LoginTests';
import { UserPreferences } from '../../pageobjects/dashboard/UserPreferences';
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';

suite(`"Revoke OAuth" test`, function (): void {
suite('"Revoke OAuth" test', function (): void {
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
const userPreferences: UserPreferences = e2eContainer.get(CLASSES.UserPreferences);
const gitService: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER || 'github';
Expand All @@ -27,8 +27,8 @@ suite(`"Revoke OAuth" test`, function (): void {
await userPreferences.checkTabsAvailability();

await userPreferences.openGitServicesTab();
const selectedService: string = await userPreferences.getServiceConfig(gitService);

const selectedService: string = userPreferences.getServiceConfig(gitService);
await userPreferences.revokeGitService(selectedService);
});
});
8 changes: 4 additions & 4 deletions tests/e2e/utils/DevWorkspaceConfigurationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class DevWorkspaceConfigurationHelper {
e.kind === 'DevWorkspace'
? (content.DevWorkspace = e)
: e.kind === 'DevWorkspaceTemplate'
? (content.DevWorkspaceTemplate = e)
: Logger.error(
'Problems with configuration parsing, string should be in format "DevWorkspace\\n---\\nDevWorkspaceTemplate"'
);
? (content.DevWorkspaceTemplate = e)
: Logger.error(
'Problems with configuration parsing, string should be in format "DevWorkspace\\n---\\nDevWorkspaceTemplate"'
);
});

return content;
Expand Down

0 comments on commit c6d66af

Please sign in to comment.