forked from hyperledger-archives/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stabilise and Activate Protractor tests (hyperledger-archives#1625)
* stabilise protractor * modify return code conditioning * removed git cached download item
- Loading branch information
Showing
19 changed files
with
856 additions
and
696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { browser, element, by } from 'protractor'; | ||
import { OperationsHelper } from '../utils/operations-helper'; | ||
|
||
export class EditorFile { | ||
|
||
static retrieveEditorCodeMirrorText() { | ||
return OperationsHelper.retriveTextFromElement(element(by.id('editor-file_CodeMirror'))); | ||
} | ||
|
||
static retrieveEditorText() { | ||
return OperationsHelper.retriveTextFromElement(element(by.css('.readme'))); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { browser, element, by } from 'protractor'; | ||
import { ExpectedConditions } from 'protractor'; | ||
import { OperationsHelper } from '../utils/operations-helper'; | ||
|
||
let scrollMe = (target) => { | ||
target.scrollIntoView(true); | ||
}; | ||
|
||
export class Editor { | ||
|
||
// Click AddFile button | ||
static clickAddFile() { | ||
return OperationsHelper.click(element(by.id('editor_addfile'))); | ||
} | ||
|
||
// Click Export button | ||
static clickExportBND() { | ||
return OperationsHelper.click(element(by.id('editor_export'))); | ||
} | ||
|
||
// Click deploy button | ||
static clickDeployBND() { | ||
return OperationsHelper.click(element(by.id('editor_deploy'))); | ||
} | ||
|
||
// Click import button | ||
static clickImportBND() { | ||
return OperationsHelper.click(element(by.id('editor_import'))); | ||
} | ||
|
||
// RETRIEVE ACTIONS | ||
// Retrieve Editor Side Navigation FileNames | ||
static retrieveNavigatorFileNames() { | ||
// Due to scroll bar, need to scroll element into view in order to inspect text | ||
return OperationsHelper.retriveMatchingElementsByCSS('.side-bar-nav', '.flex-container') | ||
.map((elm) => { browser.executeScript(scrollMe, elm); | ||
browser.wait(ExpectedConditions.visibilityOf(elm), 5000); | ||
return elm.getText(); }); | ||
} | ||
|
||
// Retrieve Editor Side Navigation File Action buttons (Add/Deploy) | ||
static retrieveNavigatorFileActionButtons() { | ||
return OperationsHelper.retriveMatchingElementsByCSS('.files', '[type="button"]') | ||
.map((elm) => { return {text: elm.getText(), enabled: elm.isEnabled()}; }); | ||
} | ||
|
||
// Retrieve Editor Side Navigation Action Buttons | ||
static retrieveBusinessArchiveActionButtons() { | ||
return OperationsHelper.retriveMatchingElementsByCSS('.actions', '[type="button"]') | ||
.map((elm) => { return {text: elm.getText(), enabled: elm.isEnabled()}; }); | ||
} | ||
|
||
// Retrieve Editor Side Navigation File Elements | ||
static retrieveNavigatorFileElements() { | ||
return OperationsHelper.retriveMatchingElementsByCSS('.side-bar-nav', '.flex-container'); | ||
} | ||
|
||
// Retrieve Editor Deployed Package Name, visible only when readme is selected | ||
static retrieveDeployedPackageName() { | ||
return OperationsHelper.retriveTextFromElement(element(by.id('editor_deployedPackageName'))); | ||
} | ||
|
||
// Retrieve current 'active' file from navigator | ||
static retrieveNavigatorActiveFile() { | ||
return OperationsHelper.retriveMatchingElementsByCSS('.files', '.active') | ||
.map((elm) => { browser.executeScript(scrollMe, elm); | ||
browser.wait(ExpectedConditions.visibilityOf(elm), 5000); | ||
return elm.getText(); }); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { browser, element, by } from 'protractor'; | ||
import { ExpectedConditions } from 'protractor'; | ||
|
||
import { OperationsHelper } from '../utils/operations-helper'; | ||
import { dragDropFile } from '../utils/fileUtils'; | ||
|
||
export class ErrorAlert { | ||
|
||
// Close | ||
static clickCloseError() { | ||
browser.wait(ExpectedConditions.visibilityOf(element(by.css('.error'))), 5000); | ||
return OperationsHelper.click(element(by.id('error_close'))); | ||
} | ||
|
||
// wait to disappear | ||
static waitToDisappear() { | ||
browser.wait(ExpectedConditions.invisibilityOf(element(by.css('.error'))), 5000); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { browser, element, by } from 'protractor'; | ||
import { ExpectedConditions } from 'protractor'; | ||
import { OperationsHelper } from '../utils/operations-helper'; | ||
|
||
export class Replace { | ||
|
||
// Cancel replace | ||
static cancelReplace() { | ||
// Replace modal should be present | ||
browser.wait(ExpectedConditions.visibilityOf(element(by.css('.replace'))), 5000); | ||
OperationsHelper.click(element(by.id('replace_cancel'))); | ||
} | ||
|
||
// Confirm Replace | ||
static confirmReplace() { | ||
// Replace modal should be present | ||
browser.wait(ExpectedConditions.visibilityOf(element(by.css('.replace'))), 5000); | ||
OperationsHelper.click(element(by.id('replace_confirm'))); | ||
browser.wait(ExpectedConditions.invisibilityOf(element(by.css('.replace'))), 5000); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* Import query file | ||
*/ | ||
|
||
query Q1 { | ||
description: "Select all drivers" | ||
description: "Select all SampleAsset" | ||
statement: SELECT org.acme.sample.SampleAsset | ||
} | ||
} |
Oops, something went wrong.