devops:tests:protractor
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devops:tests:protractor [2020/10/08 10:12] – skipidar | devops:tests:protractor [2023/11/01 07:15] (current) – ↷ Page moved from camunda:devops:tests:protractor to devops:tests:protractor skipidar | ||
---|---|---|---|
Line 16: | Line 16: | ||
===== UI Tests ===== | ===== UI Tests ===== | ||
- | ====== test_config.js ====== | ||
- | This is the configuration file used by protractor for managing any config parameter used globally within the web application. | ||
- | |||
- | <sxh javascript> | ||
- | require(' | ||
- | let options = require(" | ||
- | var Jasmine2HtmlReporter = require(' | ||
- | exports.config = { | ||
- | framework: ' | ||
- | seleniumAddress: | ||
- | //specs is used for when calling protractor without passing suites to run | ||
- | specs: [' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | //' | ||
- | // //' | ||
- | //specs: [' | ||
- | |||
- | //Suites defined to run tests on Dev or Stage | ||
- | suites: { | ||
- | //dev: ' | ||
- | // dev: [' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // // ' | ||
- | // // ' | ||
- | // // ' | ||
- | // // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | dev: [' | ||
- | // stage: [' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | // ' | ||
- | stage: [' | ||
- | }, | ||
- | onPrepare: function () { | ||
- | browser.driver.manage().window().maximize(); | ||
- | |||
- | jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({ | ||
- | savePath: ' | ||
- | screenshotsFolder: | ||
- | takeScreenshots: | ||
- | takeScreenshotsOnlyOnFailures: | ||
- | fixedScreenshotName: | ||
- | showPassed: false, | ||
- | filePrefix: ' | ||
- | // consolidate: | ||
- | // consolidateAll: | ||
- | })); | ||
- | |||
- | var AllureReporter = require(' | ||
- | jasmine.getEnv().addReporter(new AllureReporter({ | ||
- | resultsDir: ' | ||
- | })); | ||
- | |||
- | var jasmineReporters = require(' | ||
- | jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({ | ||
- | consolidateAll: | ||
- | savePath: ' | ||
- | filePrefix: ' | ||
- | }) | ||
- | ) | ||
- | }, | ||
- | |||
- | ignoreUncaughtExceptions: | ||
- | capabilities: | ||
- | browserName: | ||
- | noGlobals: false, | ||
- | binary: ' | ||
- | // | ||
- | // | ||
- | chromeOptions: | ||
- | useAutomationExtension: | ||
- | args: [" | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | // args: [ " | ||
- | } | ||
- | }, | ||
- | // capabilities: | ||
- | // | ||
- | // ' | ||
- | // args: [' | ||
- | // | ||
- | // // | ||
- | // // | ||
- | // } | ||
- | // }, | ||
- | // capabilities: | ||
- | // | ||
- | // | ||
- | // // | ||
- | // // | ||
- | // | ||
- | // | ||
- | // args: [" | ||
- | // " | ||
- | // " | ||
- | // " | ||
- | // " | ||
- | // " | ||
- | // // args: [ " | ||
- | // } | ||
- | // }, | ||
- | |||
- | // TODO: Initial work proves multi browser testing works. | ||
- | // multiCapabilities: | ||
- | // | ||
- | // ' | ||
- | // ' | ||
- | // } | ||
- | // }, | ||
- | // | ||
- | // ' | ||
- | // ' | ||
- | // } | ||
- | // } | ||
- | // ], | ||
- | |||
- | // Options to be passed to Jasmine. | ||
- | jasmineNodeOpts: | ||
- | defaultTimeoutInterval: | ||
- | }, | ||
- | params: { | ||
- | gWidgetID: ' | ||
- | gCampusID: ' | ||
- | } | ||
- | } | ||
- | |||
- | </ | ||
Line 172: | Line 21: | ||
NPM dependency configs. | NPM dependency configs. | ||
- | <code> | + | <sxh > |
{ | { | ||
" | " | ||
Line 201: | Line 50: | ||
} | } | ||
- | </code> | + | </sxh> |
Line 210: | Line 59: | ||
config files and then may be used in the tests. | config files and then may be used in the tests. | ||
- | < | + | < |
if [ $# -eq 0 ] | if [ $# -eq 0 ] | ||
then | then | ||
Line 220: | Line 69: | ||
if [ $1 == ' | if [ $1 == ' | ||
then | then | ||
- | export | + | export |
export SPACE_NAME=" | export SPACE_NAME=" | ||
- | export | + | export |
export SPACE_ISPARTOF=b5c703a7-627d-4562-ba2c-6399557c670d | export SPACE_ISPARTOF=b5c703a7-627d-4562-ba2c-6399557c670d | ||
export DEVICE_NAME=" | export DEVICE_NAME=" | ||
Line 236: | Line 85: | ||
elif [ $1 == ' | elif [ $1 == ' | ||
then | then | ||
+ | export APIURL=my.api.com | ||
export FLOOR_NAME=1OG | export FLOOR_NAME=1OG | ||
export SPACE_NAME=" | export SPACE_NAME=" | ||
- | export | + | export |
export SPACE_ISPARTOF=6bfed7de-ccbc-4780-b834-5d8cbf73560f | export SPACE_ISPARTOF=6bfed7de-ccbc-4780-b834-5d8cbf73560f | ||
export DEVICE_NAME=" | export DEVICE_NAME=" | ||
Line 270: | Line 120: | ||
protractor test_config.js --suite $TARGETAWSACCOUNT | protractor test_config.js --suite $TARGETAWSACCOUNT | ||
## | ## | ||
+ | |||
</ | </ | ||
Line 280: | Line 131: | ||
The file where the environment variables are injected into the JS | The file where the environment variables are injected into the JS | ||
- | <code> | + | <sxh javascript> |
require(' | require(' | ||
Line 292: | Line 143: | ||
}, | }, | ||
params: { | params: { | ||
+ | apiUrl: process.env.APIURL, | ||
+ | buildingIdB: | ||
floorName: process.env.FLOOR_NAME, | floorName: process.env.FLOOR_NAME, | ||
spaceName: process.env.SPACE_NAME, | spaceName: process.env.SPACE_NAME, | ||
Line 338: | Line 191: | ||
</ | </ | ||
- | === test_config.js === | ||
- | <sxh javascript> | + | ====== test_config.js ====== |
+ | This is the configuration file used by protractor for managing any config parameter used globally within the web application. | ||
+ | Uses the config.js file | ||
+ | |||
+ | <sxh javascript> | ||
require(' | require(' | ||
- | let options = require(" | + | let options = require(" |
var Jasmine2HtmlReporter = require(' | var Jasmine2HtmlReporter = require(' | ||
exports.config = { | exports.config = { | ||
Line 360: | Line 216: | ||
' | ' | ||
' | ' | ||
+ | //' | ||
+ | // //' | ||
+ | //specs: [' | ||
//Suites defined to run tests on Dev or Stage | //Suites defined to run tests on Dev or Stage | ||
Line 435: | Line 294: | ||
} | } | ||
}, | }, | ||
+ | // capabilities: | ||
+ | // | ||
+ | // ' | ||
+ | // args: [' | ||
+ | // | ||
+ | // // | ||
+ | // // | ||
+ | // } | ||
+ | // }, | ||
+ | // capabilities: | ||
+ | // | ||
+ | // | ||
+ | // // | ||
+ | // // | ||
+ | // | ||
+ | // | ||
+ | // args: [" | ||
+ | // " | ||
+ | // " | ||
+ | // " | ||
+ | // " | ||
+ | // " | ||
+ | // // args: [ " | ||
+ | // } | ||
+ | // }, | ||
+ | |||
+ | // TODO: Initial work proves multi browser testing works. | ||
+ | // multiCapabilities: | ||
+ | // | ||
+ | // ' | ||
+ | // ' | ||
+ | // } | ||
+ | // }, | ||
+ | // | ||
+ | // ' | ||
+ | // ' | ||
+ | // } | ||
+ | // } | ||
+ | // ], | ||
// Options to be passed to Jasmine. | // Options to be passed to Jasmine. | ||
Line 445: | Line 343: | ||
} | } | ||
} | } | ||
- | |||
</ | </ | ||
Line 451: | Line 348: | ||
====== Example test ====== | ====== Example test ====== | ||
+ | In the test the injected environment variables can be retireved via **config.params** | ||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | config.params.apiUrl | ||
+ | </ | ||
+ | |||
+ | <sxh javascript> | ||
+ | require(' | ||
+ | var config = require(' | ||
+ | var common = require(' | ||
+ | const { element, browser } = require(' | ||
+ | var EC = protractor.ExpectedConditions; | ||
+ | |||
+ | describe(' | ||
+ | // | ||
+ | common.SetupInitialize(" | ||
+ | |||
+ | //Login, Navigate to Building B files, validate that it loads | ||
+ | it(' | ||
+ | apiUrl = config.params.apiUrl; | ||
+ | |||
+ | var fPlans = element.all(by.cssContainingText(' | ||
+ | var fsvg = element.all(by.cssContainingText(' | ||
+ | var fThisIs = element.all(by.cssContainingText(' | ||
+ | |||
+ | browser.get(apiUrl + ' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(fPlans, | ||
+ | fPlans.click(); | ||
+ | browser.wait(EC.visibilityOf(fsvg, | ||
+ | expect(fsvg).not.toBe(null); | ||
+ | browser.wait(EC.visibilityOf(fThisIs, | ||
+ | expect(fThisIs).not.toBe(null); | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * Confirm details content is present and viable for ifc file | ||
+ | * */ | ||
+ | it(' | ||
+ | element.all(by.cssContainingText(' | ||
+ | browser.sleep(1000); | ||
+ | browser.wait(EC.visibilityOf(element.all(by.css(' | ||
+ | element.all(by.css(' | ||
+ | |||
+ | var detailsDrawer = element(by.css(' | ||
+ | expect(detailsDrawer.isPresent()).toBe(true); | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | var filterBox = element(by.css(' | ||
+ | browser.wait(EC.visibilityOf(filterBox), | ||
+ | expect(filterBox.isPresent()).toBe(true); | ||
+ | expect(filterBox.getText()).toBe(' | ||
+ | expect(element(by.css(' | ||
+ | |||
+ | var labels = element.all(by.css(' | ||
+ | var texts = element.all(by.css(' | ||
+ | |||
+ | expect(labels.get(2).getText()).toBe(' | ||
+ | expect(labels.get(3).getText()).toBe(' | ||
+ | expect(labels.get(4).getText()).toBe(' | ||
+ | expect(labels.get(5).getText()).toBe(' | ||
+ | expect(labels.get(6).getText()).toBe(' | ||
+ | // | ||
+ | |||
+ | element(by.css(' | ||
+ | browser.sleep(1000); | ||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(3000); | ||
+ | |||
+ | var columns = element.all(by.css(' | ||
+ | browser.wait(EC.visibilityOf(columns.get(0)), | ||
+ | columns.get(0).click(); | ||
+ | expect(columns.get(0).isPresent()).toBe(true); | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * IFC that is source for should not be able to be deleted. | ||
+ | * */ | ||
+ | |||
+ | it(' | ||
+ | browser.sleep(3000); | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(ifcFile), | ||
+ | ifcFile.click(); | ||
+ | browser.sleep(4000); | ||
+ | element(by.cssContainingText(' | ||
+ | browser.wait(EC.presenceOf(element(by.css(' | ||
+ | // | ||
+ | browser.sleep(3500); | ||
+ | expect(element(by.cssContainingText(' | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * Renaming of building files | ||
+ | * Ensure that file name changes are propogated through both rename option and edit option | ||
+ | * */ | ||
+ | describe(' | ||
+ | |||
+ | it (' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(ifcFile), | ||
+ | ifcFile.click(); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | var displayName = element.all(by.css(' | ||
+ | var btnPrimary = element(by.css(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(displayName, | ||
+ | displayName.clear(); | ||
+ | displayName.sendKeys(' | ||
+ | btnPrimary.click(); | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | expect(ifcFile.getText()).toBe(' | ||
+ | }); | ||
+ | |||
+ | it (' | ||
+ | browser.sleep(1000); | ||
+ | var displayName = element.all(by.css(' | ||
+ | var btnPrimary = element(by.css(' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(displayName, | ||
+ | displayName.clear(); | ||
+ | displayName.sendKeys(' | ||
+ | |||
+ | // | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | btnPrimary.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | expect(ifcFile.getText()).toBe(' | ||
+ | browser.sleep(1000); | ||
+ | }); | ||
+ | |||
+ | it (' | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | var displayName = element.all(by.css(' | ||
+ | var btnPrimary = element(by.css(' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(displayName, | ||
+ | |||
+ | displayName.clear(); | ||
+ | displayName.sendKeys(' | ||
+ | displayName.click(); | ||
+ | browser.sleep(5000); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(btnPrimary), | ||
+ | btnPrimary.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | |||
+ | var arrowRight = element(by.css(" | ||
+ | |||
+ | expect(ifcFile.getText()).toBe(' | ||
+ | }); | ||
+ | |||
+ | it (' | ||
+ | |||
+ | browser.sleep(2000); | ||
+ | var displayName = element.all(by.css(' | ||
+ | var btnPrimary = element(by.css(' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(displayName, | ||
+ | displayName.clear(); | ||
+ | displayName.sendKeys(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | expect(btnPrimary.isEnabled()).toBe(true); | ||
+ | btnPrimary.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | |||
+ | //var arrowRight = element(by.css(" | ||
+ | // | ||
+ | |||
+ | }); | ||
+ | |||
+ | it (' | ||
+ | |||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | var arrowRight = element(by.css(" | ||
+ | |||
+ | arrowRight.isPresent().then(function(result) { | ||
+ | if (result) { | ||
+ | |||
+ | browser.wait(EC.visibilityOf(arrowRight), | ||
+ | arrowRight.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | expect(ifcFile.getText()).toBe(' | ||
+ | browser.sleep(1000); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* Neg case - Long building names | ||
+ | * Ensure that building names past api allowable length result in an error | ||
+ | * */ | ||
+ | it(' | ||
+ | console.log(' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | var toastMessage = element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(ifcFile), | ||
+ | ifcFile.click(); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.sleep(1500); | ||
+ | var displayName = element.all(by.css(' | ||
+ | browser.wait(EC.visibilityOf(displayName, | ||
+ | displayName.sendKeys(' | ||
+ | //change file name to a value we know will fail | ||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | element(by.css(' | ||
+ | // | ||
+ | browser.sleep(4000); | ||
+ | browser.wait(EC.visibilityOf(toastMessage, | ||
+ | expect(toastMessage.getText()).toBe(' | ||
+ | toastMessage.click(); | ||
+ | //close toast message | ||
+ | }); | ||
+ | |||
+ | it(' | ||
+ | var ifcFile = element(by.cssContainingText(' | ||
+ | var arrowRight = element(by.css(" | ||
+ | |||
+ | browser.wait(EC.visibilityOf(arrowRight), | ||
+ | arrowRight.click(); | ||
+ | // close side menu | ||
+ | |||
+ | browser.wait(EC.visibilityOf(ifcFile), | ||
+ | expect(ifcFile.getText()).toBe(' | ||
+ | }); | ||
+ | |||
+ | it(' | ||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.sleep(1500); | ||
+ | |||
+ | var txtDescription = element(by.name(' | ||
+ | browser.wait(EC.visibilityOf(txtDescription), | ||
+ | txtDescription.clear(); | ||
+ | txtDescription.sendKeys(' | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.linkText(' | ||
+ | expect(element(by.id(' | ||
+ | |||
+ | browser.sleep(3000); | ||
+ | }); | ||
+ | |||
+ | it(' | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(1500); | ||
+ | |||
+ | var txtDescription = element(by.name(' | ||
+ | browser.wait(EC.visibilityOf(txtDescription), | ||
+ | txtDescription.clear(); | ||
+ | txtDescription.sendKeys(' | ||
+ | txtDescription.sendKeys(protractor.Key.BACK_SPACE); | ||
+ | txtDescription.clear(); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.linkText(' | ||
+ | expect(element(by.id(' | ||
+ | expect(element(by.css(' | ||
+ | |||
+ | }); | ||
+ | }); | ||
+ | /* | ||
+ | * Create Folders | ||
+ | * From Root directory | ||
+ | * Create folder 1 and folder 2 , via the folder creation menu | ||
+ | * assert that folders exist in table and in side bar | ||
+ | * */ | ||
+ | describe(' | ||
+ | it (' | ||
+ | browser.sleep(3000); | ||
+ | var folder1 = element(by.cssContainingText(' | ||
+ | var folder2 = element(by.cssContainingText(' | ||
+ | var btnNew = element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(btnNew), | ||
+ | btnNew.click(); | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | element(by.css(' | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | browser.wait(EC.visibilityOf(folder1) ,20000); | ||
+ | expect(folder1.isPresent()).toBe(true); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | element(by.css(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(folder2), | ||
+ | //check folder is in table | ||
+ | expect(folder2.isPresent()).toBe(true); | ||
+ | // check folder is in sidebar | ||
+ | expect(element(by.cssContainingText(' | ||
+ | }); | ||
+ | |||
+ | |||
+ | /* | ||
+ | * Trigger navigation via folder icon click | ||
+ | * get list of folders | ||
+ | * click first folder ( should be 2D Floorplans) | ||
+ | * confirm we were navigated by folder contents | ||
+ | * */ | ||
+ | it(' | ||
+ | var folders = $$(' | ||
+ | var fPlans = element.all(by.cssContainingText(' | ||
+ | // There should be three folders currently in the table | ||
+ | expect(folders.count()).toBe(3); | ||
+ | // navigate to 2D Floorplans folder through click on the folder icon | ||
+ | fPlans.click(); | ||
+ | // | ||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | // expect we have loaded the contents of the folder | ||
+ | expect(element.all(by.cssContainingText(' | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * Trigger navigation via breadcrumb | ||
+ | * Analyze bread crumbs in current path ( should be started in 2d floor plans folder) | ||
+ | * click breadcrumb to go to building files | ||
+ | * confirm we were navigated by folder contents | ||
+ | * confirm breadcrumbs were rebuilt properly. | ||
+ | * */ | ||
+ | it (' | ||
+ | // get list of breadcrumbs, | ||
+ | var crumbs = $$(' | ||
+ | expect(crumbs.count()).toBe(2); | ||
+ | expect(crumbs.get(0).getText()).toBe(' | ||
+ | expect(crumbs.get(1).getText()).toContain(' | ||
+ | element(by.cssContainingText(' | ||
+ | //Expect navigation back to root folder - Table | ||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | expect(element(by.cssContainingText(' | ||
+ | |||
+ | // Expect crumbs to be 1 long after navigation | ||
+ | var newCrumbs = $$(' | ||
+ | expect(newCrumbs.count()).toBe(1); | ||
+ | expect(newCrumbs.get(0).getText()).toBe(' | ||
+ | }); | ||
+ | |||
+ | /** | ||
+ | * Creation of a sub-folder | ||
+ | * select folder 1, choose create new folder | ||
+ | * interact with folder modal , provide name and confirmation | ||
+ | * after- confirm that the folder exists | ||
+ | **/ | ||
+ | it(' | ||
+ | // select folder 1 and click | ||
+ | element.all(by.cssContainingText(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | // select create new folder | ||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | element(by.css(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | |||
+ | // Folder should be created | ||
+ | var folderInsideFolder = element.all(by.css(' | ||
+ | browser.wait(EC.visibilityOf(folderInsideFolder, | ||
+ | expect(folderInsideFolder.getText()).toBe(' | ||
+ | |||
+ | element.all(by.cssContainingText(' | ||
+ | |||
+ | }); | ||
+ | }); | ||
+ | |||
+ | describe(' | ||
+ | /** | ||
+ | * disabling this test until we solve the challenge of uploading files in the pipeline | ||
+ | * Navigate to folder 1 clicks ' | ||
+ | * selecting a file, clicks ' | ||
+ | * Check for file presence | ||
+ | * */ | ||
+ | | ||
+ | xit(' | ||
+ | |||
+ | var path = require(' | ||
+ | var remote = require(' | ||
+ | browser.setFileDetector(new remote.FileDetector()); | ||
+ | |||
+ | element.all(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | |||
+ | var textFileToUpload = ' | ||
+ | var ifcFileToUpload = ' | ||
+ | |||
+ | absolutePath = path.resolve(__dirname, | ||
+ | absolutePath2 = path.resolve(__dirname, | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | element(by.css(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | var uploadButton = element(by.css(' | ||
+ | expect(uploadButton.isEnabled()).toBe(true); | ||
+ | uploadButton.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf($(' | ||
+ | expect($(' | ||
+ | browser.wait(EC.invisibilityOf($(' | ||
+ | |||
+ | // | ||
+ | // | ||
+ | |||
+ | }); | ||
+ | |||
+ | xit(' | ||
+ | |||
+ | var path = require(' | ||
+ | var remote = require(' | ||
+ | browser.setFileDetector(new remote.FileDetector()); | ||
+ | |||
+ | var uploadButton = element(by.css(' | ||
+ | |||
+ | var textFileToUpload = ' | ||
+ | var ifcFileToUpload = ' | ||
+ | |||
+ | absolutePath = path.resolve(__dirname, | ||
+ | absolutePath2 = path.resolve(__dirname, | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | element(by.css(' | ||
+ | browser.sleep(1000); | ||
+ | uploadButton.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf($(' | ||
+ | expect($(' | ||
+ | browser.wait(EC.invisibilityOf($(' | ||
+ | // | ||
+ | // | ||
+ | |||
+ | console.log(" | ||
+ | }); | ||
+ | }; | ||
+ | /* | ||
+ | * Currently working test disabled until clean up implemented in next test | ||
+ | * */ | ||
+ | it(' | ||
+ | |||
+ | element.all(by.cssContainingText(' | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | var ifcFile = element.all(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(ifcFile, | ||
+ | |||
+ | ifcFile.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | //note: using a browser.wait here instead of .sleep causes timeout. | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | var cutButton = element(by.css(' | ||
+ | | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | |||
+ | let ifcFiles = element.all(by.cssContainingText(' | ||
+ | expect(ifcFiles.count()).toBe(2); | ||
+ | browser.sleep(1000); | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * Inprogress soec | ||
+ | * */ | ||
+ | it(' | ||
+ | |||
+ | apiUrl = config.params.apiUrl; | ||
+ | browser.get(apiUrl + ' | ||
+ | browser.sleep(5000); | ||
+ | let ifcFile = element(by.cssContainingText(' | ||
+ | expect(ifcFile).not.toBe(null); | ||
+ | browser.wait(EC.visibilityOf(ifcFile, | ||
+ | ifcFile.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | //note: using a browser.wait here instead of .sleep causes timeout. | ||
+ | var moveButton = element(by.cssContainingText(' | ||
+ | expect(moveButton).not.toBe(null); | ||
+ | moveButton.click(); | ||
+ | // Wait for modal here. | ||
+ | browser.wait(EC.visibilityOf(element.all(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | // wait for tree content to load - need a better check | ||
+ | let target = element.all(by.cssContainingText(' | ||
+ | target.click(); | ||
+ | |||
+ | let moveBtn = element.all(by.cssContainingText(' | ||
+ | moveBtn.click(); | ||
+ | // | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | browser.wait(EC.invisibilityOf(element(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | //Verify that item is not in current folder | ||
+ | var detailsDrawer = element(by.cssContainingText(' | ||
+ | expect(detailsDrawer.isPresent()).toBe(false); | ||
+ | }); | ||
+ | |||
+ | it(' | ||
+ | let ifcFile = element(by.cssContainingText(' | ||
+ | let folder1 = element.all(by.cssContainingText(' | ||
+ | //navigate to folder 1 and validate it is there. | ||
+ | browser.wait(EC.invisibilityOf(ifcFile), | ||
+ | browser.wait(EC.visibilityOf(folder1, | ||
+ | folder1.click(); | ||
+ | |||
+ | browser.wait(EC.visibilityOf(ifcFile, | ||
+ | expect(ifcFile.isPresent()).toBe(true); | ||
+ | //go back to root for next test | ||
+ | element.all(by.cssContainingText(' | ||
+ | }); | ||
+ | /* | ||
+ | * delete of Folders | ||
+ | * clicks folder 2, and deletes. | ||
+ | * Clicks folders 1 and deletes | ||
+ | * | ||
+ | * */ | ||
+ | it(' | ||
+ | browser.sleep(1000); | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | var folder = element(by.cssContainingText(' | ||
+ | folder.click(); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | var deleteButton = element(by.css(' | ||
+ | |||
+ | deleteButton.click(); | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | |||
+ | element(by.css(' | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | browser.wait(EC.invisibilityOf(element(by.cssContainingText(' | ||
+ | browser.sleep(2000); | ||
+ | expect(folder.isPresent()).toBe(false); | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | |||
+ | folder = element(by.cssContainingText(' | ||
+ | folder.click(); | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | deleteButton = element(by.css(' | ||
+ | deleteButton.click(); | ||
+ | browser.sleep(1000); | ||
+ | |||
+ | element(by.css(' | ||
+ | browser.wait(EC.visibilityOf(element(by.cssContainingText(' | ||
+ | browser.wait(EC.visibilityOf(element(by.css(' | ||
+ | let loader = element(by.css(' | ||
+ | browser.wait(EC.not(EC.presenceOf(loader))); | ||
+ | |||
+ | browser.sleep(1000); | ||
+ | expect(folder.isPresent()).toBe(false); | ||
+ | }); | ||
+ | |||
+ | /* | ||
+ | * upload without file path provided | ||
+ | * clicks ' | ||
+ | * when no file is selected and then clicks ' | ||
+ | * */ | ||
+ | it ('wont allow upload without file path provided', | ||
+ | |||
+ | element(by.cssContainingText(' | ||
+ | element(by.cssContainingText(' | ||
+ | |||
+ | // | ||
+ | |||
+ | var cancelButton = element(by.css(' | ||
+ | var uploadButton = element(by.css(' | ||
+ | |||
+ | browser.wait(EC.visibilityOf(cancelButton), | ||
+ | expect(uploadButton.isEnabled()).toBe(false); | ||
+ | expect(cancelButton.isPresent()).toBe(true); | ||
+ | |||
+ | cancelButton.click(); | ||
+ | browser.sleep(1000); | ||
+ | expect(cancelButton.isPresent()).toBe(false); | ||
+ | }); | ||
+ | }); | ||
+ | /* | ||
+ | * Check files details - **Currently disabled as uploads not working on pipeline. | ||
+ | * first clicks ifc file, checks if drawer shows up, changes description of file, downloads file, clicks | ||
+ | * ' | ||
+ | | ||
+ | * clicks ' | ||
+ | * ' | ||
+ | * */ | ||
+ | if(config.params.targetAwsAccount ==" | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | var detailsDrawer = element(by.css(' | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | var downloadButton = element(by.css(' | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | var labels = element.all(by.css(' | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | var txtDescription = element(by.name(' | ||
+ | txtDescription.clear(); | ||
+ | txtDescription.sendKeys(' | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | var historyButton = element(by.linkText(' | ||
+ | var createButton = element(by.linkText(' | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | var fileName = element(by.cssContainingText(' | ||
+ | | ||
+ | //click cancel button | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | }); | ||
+ | }; | ||
+ | |||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | </ |
devops/tests/protractor.1602151959.txt.gz · Last modified: (external edit)