Skip to content

Commit

Permalink
fix tests for Che Multiuser
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
  • Loading branch information
akurinnoy committed Sep 11, 2019
1 parent f91d5c8 commit 3a533c2
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ export class OrganizationDetailsController {
* @param {string} tab
*/
updateSelectedTab(tab: string): void {
this.selectedTabIndex = parseInt(this.tab[tab], 10);
const tabIndex = parseInt(this.tab[tab], 10);
this.selectedTabIndex = isNaN(tabIndex) ? 0 : tabIndex;
}

/**
Expand All @@ -233,7 +234,7 @@ export class OrganizationDetailsController {
* @param {number} tabIndex
*/
onSelectTab(tabIndex?: number): void {
let param: { tab?: string } = {};
const param: { tab?: string } = {};
if (angular.isDefined(tabIndex)) {
param.tab = Tab[tabIndex];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
che-label-name="Delete Organization"
che-label-description="This is irreversible. Deleting your organization will also destroy organization workspaces and stacks.">
<che-button-danger che-button-title="Delete"
class="delete-organization"
ng-click="organizationDetailsController.deleteOrganization(t)"></che-button-danger>
</che-label-container>
</ng-form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ export class OrganizationMemberDialogController {
this.resourcesService = resourcesService;

this.isProcessing = false;
}

$onInit(): void {
this.organizationRoles = this.resourcesService.getOrganizationRoles();

this.emails = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<project-source-selector devfile="createWorkspaceController.selectedDevfile"></project-source-selector>
</che-label-container>
<che-label-container>
<che-button-save-flat class="create-workspace-footer-button"
<che-button-save-flat id="create-workspace-footer-button"
name="saveButton"
che-button-title="Create & Open"
ng-click="createWorkspaceController.createWorkspaceAndOpenIDE()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ md-content.create-workspace-content
.create-workspace-content-hidden
visibility hidden

.create-workspace-footer-button
#create-workspace-footer-button
width 100%

button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ImportGithubProjectController {
/**
* The list of GitHub repositories.
*/
private githubRepositoriesList: Array<IGithubRepository>;
private githubRepositoriesList: Array<IGithubRepository> = [];
/**
* The list of GitHub organization.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ng-show="importGithubProjectController.state == importGithubProjectController.loadingState.NO_REPO">
<div class="import-github-project-warningempty">Your GitHub repositories will appear here</div>
<div class="import-github-project-prompt">GitHub repositories can easily be imported in {{importGithubProjectController.productName}}</div>
<che-button-default class="import-github-project-button"
<che-button-default id="import-github-project-button"
che-button-icon="fa fa-github"
che-button-title="Connect your github account"
ng-click="importGithubProjectController.authenticateWithGitHub()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
border none
outline none

.import-github-project-button
#import-github-project-button
margin-top 10px
button
margin-left 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<edit-project project-names="projectSourceSelectorController.getProjectTemplateNames()"
project-template="projectSourceSelectorController.selectedProjectTemplate"
project-on-edit="projectSourceSelectorController.projectTemplateOnEdit(template)"
project-on-remove="projectSourceSelectorController.projectTemplateOnRemove()"></edit-project>
project-on-remove="projectSourceSelectorController.projectTemplateOnRemove()"
is-project-name-unique="projectSourceSelectorController.isProjectNameUnique({name: name})"></edit-project>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void typeToGitUrlField(String text) {

public WebElement waitConnectYourGithubAccountButton() {
return seleniumWebDriverHelper.waitVisibility(
By.xpath("//che-button-default[@class='import-github-project-button']/button"));
By.xpath("//*[@id='import-github-project-button']/*[contains(@class, 'che-button')]"));
}

public void clickConnectYourGithubAccountButton() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ private interface Locators {
String DIALOG_CLOSE_BUTTON_XPATH = "//che-popup//div[contains(@class, 'che-popup-header')]//i";
String DIALOG_MESSAGE_XPATH =
"//che-popup//div[contains(@class, 'che-confirm-dialog-notification')]/div";
String DIALOG_CANCEL_BUTTON = "//che-popup//che-button-notice//span";
String DIALOG_CONFIRM_BUTTON = "//che-popup//che-button-primary//span";
String DIALOG_CANCEL_BUTTON =
"//*[@id='cancel-dialog-button']/*[contains(@class, 'che-button')]";
String DIALOG_CONFIRM_BUTTON = "//*[@id='ok-dialog-button']/*[contains(@class, 'che-button')]";
}

@FindBy(xpath = Locators.DIALOG_XPATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private interface Locators {
String DONE_BUTTON_XPATH = "//button/span[text()='Done']";
String FACTORY_NAME_FIELD_CSS = "input[placeholder='Name of the factory']";
String WORKSPACES_TAB_SELECT_XPATH = "//span[text()='Workspace']/parent::md-tab-item";
String CREATE_FACTORY_ICON_XPATH = "//a/span[text()='Create Factory']";
String CREATE_FACTORY_ICON_XPATH =
"//*[@id='add-item-button']/*[contains(@class, 'che-button')]";
String ADD_CONFIGURE_ACTION_XPATH = "//md-card[@che-title='Configure Actions']//button";
String OPEN_FACTORY_BUTTON_XPATH = "//che-button-default[@che-button-title='Open']";
String CONFIGURE_ACTION_TITLE_XPATH = "//div[text()='Configure Actions']";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public interface Locators {
String TOP_CREATE_BUTTON_XPATH = "//button[@name='split-button']";
String TOP_DROPDOWN_BUTTON_XPATH = "//button[@name='dropdown-toggle']";
String TOP_EDIT_BUTTON_XPATH = "//span[text()='Create & Proceed Editing']";
String BOTTOM_CREATE_BUTTON_XPATH = "//che-button-save-flat/button[@name='saveButton']";
String BOTTOM_CREATE_BUTTON_XPATH = "//*[@id='create-workspace-footer-button']";
}

public enum Devfile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private interface Locators {

String PROJECT_NAME = "//input[@name='projectName']";
String PROJECT_DESCRIPTION = "//input[@name='projectDescription']";
String CONNECT_GITHUB_ACCOUNT_BUTTON = "//span[text()='Connect your github account']";
String CONNECT_GITHUB_ACCOUNT_BUTTON =
"//*[@id='import-github-project-button']/*[contains(@class, 'che-button')]";
String GITHUB_PROJECTS_LIST =
"//md-list[contains(@class,'import-github-project-repositories-list')]";
String GITHUB_PROJECT_CHECKBOX = "//md-checkbox[@aria-label='GitHub repository %s']";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ private interface Locators {
String MEMBERS_EMAIL_INPUT_XPATH = "//input[@name = 'email']";
String MEMBER_RADIO_BUTTON_XPATH =
"//md-radio-button//span[text()='Member' or text()='Team Developer']/ancestor::md-radio-button";
String ADMIN_RADIO_BUTTON_XPATH =
"//md-radio-button//span[text()='Admin' or text()='Team Admin']/ancestor::md-radio-button";
String ADMIN_RADIO_BUTTON_XPATH = "//md-radio-button[@value='ADMIN' or @value='TEAM_ADMIN']";
String ADD_MEMBER_BUTTON_XPATH = "//che-button-primary[@che-button-title = 'Add']//button";
String CANCEL_BUTTON_XPATH = "//che-button-cancel-flat//button";
String SAVE_BUTTON_XPATH = "//che-button-primary[@che-button-title = 'Save']/button";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ public int getIndex() {

private interface Locators {
String TOOLBAR_ID = "Organizations";
String ADD_ORGANIZATION_BUTTON_XPATH = "//che-button-primary//span[text()='Add Organization']";
String ADD_ORGANIZATION_BUTTON_XPATH =
"//*[@id='add-item-button']/*[contains(@class, 'che-button')]";
String ADD_SUB_ORGANIZATION_BUTTON_XPATH =
"//che-button-primary//span[text()='Add Sub-Organization']";
String DELETE_ORGANIZATION_BUTTON_XPATH = "//che-button-primary//span[text()='Delete']";
String DELETE_ORGANIZATION_BUTTON_XPATH =
"//*[@id='delete-item-button']/*[contains(@class, 'che-button')]";
String ORGANIZATION_LIST_XPATH = "//list-organizations//md-list";
String ORGANIZATION_LIST_ITEM_XPATH = "//list-organizations//md-list//md-item";
String ORGANIZATION_HEADER_XPATH =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ private interface Locators {
String WORKSPACE_CAP = "//input[@name = 'workspaceCap']";
String RUNNING_WORKSPACE_CAP = "//input[@name = 'runtimeCap']";
String WORKSPACE_RAM_CAP = "//input[@name = 'workspaceRamCap']";
String DELETE_ORG_BUTTON = "//button[contains(@class, 'che-button')]//span[text() = 'Delete']";
String DELETE_ORG_BUTTON =
"//*[contains(@class, 'delete-organization')]/*[contains(@class, 'che-button')]";
String DELETE_ORG_WIDGET_BUTTON =
"//div[contains(@class,'che-confirm-dialog-notification')]//span";
String SUB_ORGANIZATIONS_TAB = "//md-tab-item//span[contains(text(), 'Sub-Organizations')]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ private interface Locators {
String APPLY_CHANGES_BUTTON = "//che-button-save-flat[@class='apply-button']";
String CANCEL_CHANGES_BUTTON = "//button[@name='cancel-button']";
String CANCEL_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Cancel']";
String CLOSE_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Close']";
String DELETE_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Delete']";
String CLOSE_DIALOG_BUTTON =
"//*[@id='cancel-dialog-button']//*[contains(@class, 'che-button')]";
String DELETE_DIALOG_BUTTON = "//*[@id='ok-dialog-button']/*[contains(@class, 'che-button')]";
String UPDATE_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Update']";
String ADD_DIALOG_BUTTON = "//md-dialog[@role='dialog']//button/span[text()='Add']";
String TOOLBAR_TITLE_NAME =
Expand Down

0 comments on commit 3a533c2

Please sign in to comment.