How to use page.click method in qawolf

Best JavaScript code snippet using qawolf

map.spec.ts

Source:map.spec.ts Github

copy

Full Screen

1import { start, stop, waitForExist, resetApp, navigateTo, waitForNotExist, getUrl, pause, getText, click } from '../app';2import { MapPage } from './map.page';3import { ResourcesPage } from '../resources/resources.page';4import { DoceditPage } from '../docedit/docedit.page';5import { NavbarPage } from '../navbar.page';6import { GeometryViewPage } from '../widgets/geometry-view.page';7import { ImagePickerModalPage } from '../widgets/image-picker-modal.page';8describe('map --', function() {9 beforeAll(async done => {10 await start();11 done();12 });13 beforeEach(async done => {14 await navigateTo('settings');15 await resetApp();16 await NavbarPage.clickCloseNonResourcesTab();17 await NavbarPage.clickTab('project');18 await ResourcesPage.clickHierarchyButton('S1');19 done();20 });21 afterAll(async done => {22 await stop();23 done();24 });25 async function setPolygon() {26 await MapPage.clickMap(100, 100);27 await MapPage.clickMap(200, 200);28 await MapPage.clickMap(100, 200);29 return MapPage.clickMap(100, 100);30 }31 async function setMultiPolygon() {32 await MapPage.clickMap(100, 100);33 await MapPage.clickMap(200, 200);34 await MapPage.clickMap(100, 200);35 await MapPage.clickMap(100, 175);36 await MapPage.clickMap(100, 150);37 await MapPage.clickMap(100, 100);38 await MapPage.clickMapOption('add-polygon');39 await MapPage.clickMap(300, 300);40 await MapPage.clickMap(250, 200);41 await MapPage.clickMap(300, 200);42 await MapPage.clickMap(300, 250);43 await MapPage.clickMap(300, 275);44 return MapPage.clickMap(300, 300);45 }46 async function setPolyline() {47 await MapPage.clickMap(100, 100);48 await MapPage.clickMap(200, 200);49 await MapPage.clickMap(300, 100);50 await MapPage.clickMap(400, 200);51 return MapPage.clickMap(400, 200);52 }53 async function setUnfinishedPolyline() {54 await MapPage.clickMap(100, 100);55 await MapPage.clickMap(200, 200);56 await MapPage.clickMap(300, 100);57 return MapPage.clickMap(400, 200);58 }59 async function setMultiPolyline() {60 await MapPage.clickMap(50, 50);61 await MapPage.clickMap(100, 100);62 await MapPage.clickMap(150, 50);63 await MapPage.clickMap(200, 100);64 await MapPage.clickMap(200, 100);65 await MapPage.clickMapOption('add-polyline');66 await MapPage.clickMap(150, 100);67 await MapPage.clickMap(150, 75);68 await MapPage.clickMap(200, 150);69 await MapPage.clickMap(200, 50);70 return MapPage.clickMap(200, 50);71 }72 async function setUnfinishedMultiPolyline() {73 await MapPage.clickMap(50, 50);74 await MapPage.clickMap(100, 100);75 await MapPage.clickMap(150, 50);76 await MapPage.clickMap(200, 100);77 await MapPage.clickMapOption('add-polyline');78 await MapPage.clickMap(150, 100);79 await MapPage.clickMap(150, 75);80 await MapPage.clickMap(200, 150);81 await MapPage.clickMap(200, 50);82 }83 function setPoint() {84 return MapPage.setMarker(100, 100);85 }86 async function setMultiPoint() {87 await MapPage.clickMap(100, 100);88 await MapPage.clickMapOption('add-point');89 return MapPage.clickMap(200, 200);90 }91 async function beginCreateDocWithGeometry(geometry) {92 await ResourcesPage.clickCreateResource();93 await ResourcesPage.clickSelectCategory();94 await ResourcesPage.clickSelectGeometryType(geometry);95 return pause(500);96 }97 async function createDocWithGeometry(identifier, geometry, createGeometryFunction) {98 await beginCreateDocWithGeometry(geometry);99 await createGeometryFunction();100 await MapPage.clickMapOption('ok');101 await DoceditPage.typeInInputField('identifier', identifier);102 //ResourcesPage.scrollUp();103 return DoceditPage.clickSaveDocument();104 }105 async function createDoc(identifier, geometryType, createGeometryFunction) {106 return geometryType107 ? createDocWithGeometry(identifier, geometryType, createGeometryFunction)108 : ResourcesPage.performCreateResource(identifier);109 }110 async function createDocThenReedit(identifier, geometryType, createGeometryFunction) {111 await createDoc(identifier, geometryType, createGeometryFunction);112 return GeometryViewPage.performReeditGeometry(identifier);113 }114 it('create a new item with point geometry', async done => {115 await createDoc('doc', 'point', setPoint);116 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Punkt');117 done();118 });119 it('create a new item with multipoint geometry', async done => {120 await createDoc('doc', 'point', setMultiPoint);121 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipunkt');122 done();123 });124 it('create a new item with polyline geometry', async done => {125 await createDoc('doc', 'polyline', setPolyline);126 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polyline');127 done();128 });129 it('create a new item with multipolyline geometry', async done => {130 await createDoc('doc', 'polyline', setMultiPolyline);131 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipolyline');132 done();133 });134 it('create a new item with polygon geometry', async done => {135 await createDoc('doc', 'polygon', setPolygon);136 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polygon');137 done();138 });139 it('create a new item with multipolygon geometry', async done => {140 await createDoc('doc', 'polygon', setMultiPolygon);141 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipolygon');142 done();143 });144 it('delete a point geometry', async done => {145 await createDocThenReedit('doc', 'point', setPoint);146 await MapPage.clickMapOption('delete');147 await MapPage.clickMapOption('ok');148 await GeometryViewPage.waitForCreateGeoButtons('doc');149 done();150 });151 it('delete a polyline geometry', async done => {152 await createDocThenReedit('doc', 'polyline', setPolyline);153 await MapPage.clickMapOption('delete');154 await MapPage.clickMapOption('ok');155 await GeometryViewPage.waitForCreateGeoButtons('doc');156 done();157 });158 it('delete a polygon geometry', async done => {159 await createDocThenReedit('doc', 'polygon', setPolygon);160 await MapPage.clickMapOption('delete');161 await MapPage.clickMapOption('ok');162 await GeometryViewPage.waitForCreateGeoButtons('doc');163 done();164 });165 it('delete single polygons of a multipolygon', async done => {166 await createDocThenReedit('doc', 'polygon', setMultiPolygon);167 await MapPage.clickMapOption('delete');168 await MapPage.clickMapOption('ok');169 await GeometryViewPage.waitForLayoverToDisappear();170 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polygon');171 await ResourcesPage.clickSelectResource('doc');172 await GeometryViewPage.performReeditGeometry('doc');173 await MapPage.clickMapOption('delete');174 await MapPage.clickMapOption('ok');175 await GeometryViewPage.waitForCreateGeoButtons('doc');176 done();177 });178 it('delete single polylines of a multipolyline', async done => {179 await createDocThenReedit('doc', 'polyline', setMultiPolyline);180 await MapPage.clickMapOption('delete');181 await MapPage.clickMapOption('ok');182 await GeometryViewPage.waitForLayoverToDisappear();183 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polyline');184 await ResourcesPage.clickSelectResource('doc');185 await GeometryViewPage.performReeditGeometry('doc');186 await MapPage.clickMapOption('delete');187 await MapPage.clickMapOption('ok');188 await GeometryViewPage.waitForCreateGeoButtons('doc');189 done();190 });191 it('delete single points of a multipoint', async done => {192 await createDocThenReedit('doc', 'point', setMultiPoint);193 await MapPage.clickMapOption('delete');194 await MapPage.clickMapOption('ok');195 await GeometryViewPage.waitForLayoverToDisappear();196 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Punkt');197 await ResourcesPage.clickSelectResource('doc');198 await GeometryViewPage.performReeditGeometry('doc');199 await MapPage.clickMapOption('delete');200 await MapPage.clickMapOption('ok');201 await GeometryViewPage.waitForCreateGeoButtons('doc');202 done();203 });204 it('create a point geometry later', async done => {205 await ResourcesPage.performCreateResource('doc');206 await GeometryViewPage.clickCreateGeometry('doc', 'point');207 await MapPage.setMarker(100, 100);208 await MapPage.clickMapOption('ok');209 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Punkt');210 done();211 });212 it('create a multipoint geometry later', async done => {213 await ResourcesPage.performCreateResource('doc');214 await GeometryViewPage.clickCreateGeometry('doc', 'point').then(setMultiPoint);215 await MapPage.clickMapOption('ok');216 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipunkt');217 done();218 });219 it('create a polyline geometry later', async done => {220 await ResourcesPage.performCreateResource('doc');221 await GeometryViewPage.clickCreateGeometry('doc', 'polyline').then(setPolyline);222 await MapPage.clickMapOption('ok');223 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polyline');224 done();225 });226 it('create a multipolyline geometry later', async done => {227 await ResourcesPage.performCreateResource('doc');228 await GeometryViewPage.clickCreateGeometry('doc', 'polyline').then(setMultiPolyline);229 await MapPage.clickMapOption('ok');230 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipolyline');231 done();232 });233 it('create a polygon geometry later', async done => {234 await ResourcesPage.performCreateResource('doc');235 await GeometryViewPage.clickCreateGeometry('doc', 'polygon').then(setPolygon);236 await MapPage.clickMapOption('ok');237 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polygon');238 done();239 });240 it('create a multipolygon geometry later', async done => {241 await ResourcesPage.performCreateResource('doc');242 await GeometryViewPage.clickCreateGeometry('doc', 'polygon').then(setMultiPolygon);243 await MapPage.clickMapOption('ok');244 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipolygon');245 done();246 });247 it('cancel creating a point geometry', async done => {248 await ResourcesPage.performCreateResource('doc');249 await GeometryViewPage.clickCreateGeometry('doc', 'point');250 await MapPage.setMarker(100, 100);251 await MapPage.clickMapOption('abort');252 await GeometryViewPage.waitForCreateGeoButtons('doc');253 done();254 });255 it('cancel creating a polyline geometry', async done => {256 await ResourcesPage.performCreateResource('doc');257 await GeometryViewPage.clickCreateGeometry('doc', 'polyline');258 await setPolyline();259 await MapPage.clickMapOption('abort');260 await GeometryViewPage.waitForCreateGeoButtons('doc');261 done();262 });263 it('cancel creating a polygon geometry', async done => {264 await ResourcesPage.performCreateResource('doc');265 await GeometryViewPage.clickCreateGeometry('doc', 'polygon').then(setPolygon);266 await MapPage.clickMapOption('abort');267 await GeometryViewPage.waitForCreateGeoButtons('doc');268 done();269 });270 it('cancel deleting a point geometry', async done => {271 await createDocThenReedit('doc', 'point', setPoint);272 await MapPage.clickMapOption('delete');273 await MapPage.clickMapOption('abort');274 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Punkt');275 done();276 });277 it('cancel deleting a polyline geometry', async done => {278 await createDocThenReedit('doc', 'polyline', setPolyline);279 await MapPage.clickMapOption('delete');280 await MapPage.clickMapOption('abort');281 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polyline');282 done();283 });284 it('cancel deleting a polygon geometry', async done => {285 await createDocThenReedit('doc', 'polygon', setPolygon);286 await MapPage.clickMapOption('delete');287 await MapPage.clickMapOption('abort');288 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polygon');289 done();290 });291 it('abort item creation completely when aborting geometry editing', async done => {292 await beginCreateDocWithGeometry('point');293 await waitForExist(await ResourcesPage.getListItemMarkedNewEl());294 await setPoint();295 await MapPage.clickMapOption('abort');296 await waitForNotExist(await ResourcesPage.getListItemMarkedNewEl());297 expect(await getUrl()).toContain('resources');298 expect(await getUrl()).not.toContain('edit');299 done();300 });301 it('autofinish polyline geometry', async done => {302 await createDoc('doc', 'polyline', setUnfinishedPolyline);303 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Polyline');304 done();305 });306 it('autofinish multipolyline geometry', async done => {307 await createDoc('doc', 'polyline', setUnfinishedMultiPolyline);308 expect(await GeometryViewPage.getSelectedGeometryTypeText('doc')).toContain('Multipolyline');309 done();310 });311 it('remove and add layers in layer menu', async done => {312 await NavbarPage.clickTab('project');313 await MapPage.clickLayerButton();314 let labels = await MapPage.getLayerLabels(0);315 expect(labels.length).toBe(2);316 expect(await getText(labels[0])).toEqual('Test Layer 1');317 expect(await getText(labels[1])).toEqual('Test Layer 2');318 await MapPage.clickEditLayersButton();319 await MapPage.clickRemoveLayerButton(0);320 await MapPage.clickSaveLayersButton();321 labels = await MapPage.getLayerLabels(0);322 expect(labels.length).toBe(1);323 expect(await getText(labels[0])).toEqual('Test Layer 2');324 await MapPage.clickLayerButton();325 await ResourcesPage.clickHierarchyButton('S1');326 await MapPage.clickLayerButton();327 labels = await MapPage.getLayerLabels(0);328 expect(labels.length).toBe(0);329 labels = await MapPage.getLayerLabels(1);330 expect(labels.length).toBe(1);331 expect(await getText(labels[0])).toEqual('Test Layer 2');332 await MapPage.clickEditLayersButton();333 await MapPage.clickAddLayersButton();334 await ImagePickerModalPage.waitForCells();335 await click((await ImagePickerModalPage.getCells())[0]);336 await ImagePickerModalPage.clickAddImage();337 await MapPage.clickSaveLayersButton();338 labels = await MapPage.getLayerLabels(0);339 expect(labels.length).toBe(1);340 expect(await getText(labels[0])).toEqual('Test Layer 1');341 labels = await MapPage.getLayerLabels(1);342 expect(labels.length).toBe(1);343 expect(await getText(labels[0])).toEqual('Test Layer 2');344 await MapPage.clickLayerButton();345 done();346 });347 it('do not allow adding an image to more than one layer group', async done => {348 await MapPage.clickLayerButton();349 await MapPage.clickEditLayersButton();350 await MapPage.clickAddLayersButton();351 await pause(500);352 expect((await ImagePickerModalPage.getCells()).length).toBe(0);353 await ImagePickerModalPage.clickCloseButton();354 await MapPage.clickCancelEditingLayersButton();355 await MapPage.clickLayerButton();356 await NavbarPage.clickTab('project');357 await MapPage.clickLayerButton();358 await MapPage.clickEditLayersButton();359 await MapPage.clickRemoveLayerButton(0);360 await MapPage.clickSaveLayersButton();361 await MapPage.clickLayerButton();362 await ResourcesPage.clickHierarchyButton('S1');363 await MapPage.clickLayerButton();364 await MapPage.clickEditLayersButton();365 await MapPage.clickAddLayersButton();366 await ImagePickerModalPage.waitForCells();367 expect((await ImagePickerModalPage.getCells()).length).toBe(1);368 await ImagePickerModalPage.clickCloseButton();369 await MapPage.clickCancelEditingLayersButton();370 await MapPage.clickLayerButton();371 done();372 });...

Full Screen

Full Screen

CustomDimensions_spec.js

Source:CustomDimensions_spec.js Github

copy

Full Screen

...21 expect.screenshot(screenName).to.be.captureSelector(selector, callback, done);22 }23 function closeOpenedPopover(page)24 {25 page.click('.ui-dialog:visible .ui-button-icon-primary.ui-icon-closethick:visible');26 }27 function triggerRowAction(page, labelToClick, nameOfRowActionToTrigger)28 {29 var rowToMatch = 'td.label:contains(' + labelToClick + '):first';30 page.mouseMove('table.dataTable tbody ' + rowToMatch);31 page.mouseMove(rowToMatch + ' a.'+ nameOfRowActionToTrigger + ':visible'); // necessary to get popover to display32 page.click(rowToMatch + ' a.' + nameOfRowActionToTrigger + ':visible');33 }34 before(function () {35 testEnvironment.pluginsToLoad = ['CustomDimensions'];36 testEnvironment.save();37 });38 /**39 * VISIT DIMENSION REPORTS40 */41 it('should show the report for the selected visit dimension', function (done) {42 capturePageWrap('report_visit', function (page) {43 page.load(reportUrl + '&idDimension=2');44 }, done);45 });46 it('should add a menu item for each active visit dimension', function (done) {47 captureSelector('report_visit_mainmenu', '#secondNavBar', function (page) {48 // we only capture a screenshot of a different part of the page, no need to do anything49 }, done);50 });51 it('should add visit dimensions to goals report', function (done) {52 captureSelector('report_goals_overview', '.reportsByDimensionView', function (page) {53 page.load( "?" + urlBase + "#" + generalParams + "&module=Goals&action=index");54 page.click('.reportsByDimensionView .dimension:contains(MyName1)');55 }, done);56 });57 /**58 * ACTION DIMENSION REPORTS59 */60 it('should show the report for the selected action dimension', function (done) {61 capturePageWrap('report_action', function (page) {62 page.load(reportUrl + '&idDimension=3');63 }, done);64 });65 it('should add a menu item for each active action dimension', function (done) {66 captureSelector('report_actions_mainmenu', '#secondNavBar', function (page) {67 // we only capture a screenshot of a different part of the page, no need to do anything68 }, done);69 });70 it('should offer only segmented visitor log and row action for first level entries', function (done) {71 capturePageWrap('report_actions_rowactions', function (page) {72 page.mouseMove('td.label:contains(en):first');73 }, done);74 });75 it('should be able to render insights', function (done) {76 capturePageWrap('report_action_insights', function (page) {77 page.click('.expandDataTableFooterDrawer');78 page.click('[data-footer-icon-id="insightsVisualization"]');79 }, done);80 });81 it('should show an error when trying to open an inactive dimension', function (done) {82 capturePageWrap('report_actions_inactive', function (page) {83 page.load(reportUrl + '&idDimension=4');84 }, done);85 });86 it('should be able to open segmented visitor log', function (done) {87 captureSelector('report_actions_segmented_visitorlog', popupSelector, function (page) {88 page.load(reportUrl + "&idDimension=3");89 triggerRowAction(page, 'en', 'actionSegmentVisitorLog');90 }, done);91 });92 it('should be able to open row evolution', function (done) {93 captureSelector('report_actions_rowevolution', popupSelector, function (page) {94 page.load(reportUrl + "&idDimension=3");95 triggerRowAction(page, 'en', 'actionRowEvolution');96 }, done);97 });98 it('should be able to show subtable and offer all row actions if scope is action', function (done) {99 capturePageWrap('report_action_subtable', function (page) {100 page.load(reportUrl + "&idDimension=3");101 page.click('.dataTable .subDataTable .value:contains(en):first');102 page.mouseMove('td.label:contains(en_US)');103 }, done);104 });105 it('should be able to show row evolution for subtable', function (done) {106 captureSelector('report_action_subtable_rowevolution', popupSelector, function (page) {107 triggerRowAction(page, 'en_US', 'actionRowEvolution');108 }, done);109 });110 it('should be able to show segmented visitor log for subtable', function (done) {111 captureSelector('report_action_subtable_segmented_visitor_log', popupSelector, function (page) {112 closeOpenedPopover(page);113 triggerRowAction(page, 'en_US', 'actionSegmentVisitorLog');114 }, done);115 });116 it('should be able to show transitions for subtable', function (done) {117 capturePageWrap('report_action_subtable_transitions', function (page) {118 closeOpenedPopover(page);119 triggerRowAction(page, 'en_US', 'actionTransitions');120 }, done);121 });122 /**123 * MANAGE CUSTOM DIMENSIONS124 */125 it('should load initial manange page', function (done) {126 capturePageWrap('manage_inital', function (page) {127 page.load(manageUrl);128 }, done);129 });130 it('should open a page to create a new visit dimension and not show extractions', function (done) {131 capturePageWrap('manage_new_visit_dimension_open', function (page) {132 page.click('.configure.visit');133 }, done);134 });135 it('should be possible to create new visit dimension', function (done) {136 capturePageWrap('manage_new_visit_dimension_created', function (page) {137 page.sendKeys(".editCustomDimension #name", 'My Custom Name');138 page.click('.editCustomDimension .create');139 }, done);140 });141 it('should open a page to create a new action dimension', function (done) {142 capturePageWrap('manage_new_action_dimension_open', function (page) {143 page.click('.configure.action');144 }, done);145 });146 it('should be possible to define name, active and extractions for scope action', function (done) {147 capturePageWrap('manage_new_action_dimension_withdata', function (page) {148 page.sendKeys(".editCustomDimension #name", 'My Action Name');149 page.click('.editCustomDimension #active');150 page.sendKeys('.extraction.0 .pattern', 'myPattern_(.+)');151 page.click('.extraction.0 .icon-plus');152 page.sendKeys('.extraction.1 .pattern', 'second pattern_(.+)');153 page.click('.extraction.1 .icon-plus');154 page.sendKeys('.extraction.2 .pattern', 'thirdpattern_(.+)test');155 }, done);156 });157 it('should be possible to remove a defined extraction', function (done) {158 capturePageWrap('manage_new_action_dimension_remove_an_extraction', function (page) {159 page.click('.extraction.1 .icon-minus');160 }, done);161 });162 it('should create a new dimension', function (done) {163 capturePageWrap('manage_new_action_dimension_created', function (page) {164 page.click('.editCustomDimension .create');165 }, done);166 });167 it('should be able to open created dimension and see same data but this time with tracking instructions', function (done) {168 capturePageWrap('manage_edit_action_dimension_verify_created', function (page) {169 page.click('.manageCustomDimensions .customdimension.8 .icon-edit');170 }, done);171 });172 it('should be possible to change an existing dimension', function (done) {173 capturePageWrap('manage_edit_action_dimension_withdata', function (page) {174 page.sendKeys(".editCustomDimension #name", 'ABC');175 page.click('.editCustomDimension #active');176 page.click('.editCustomDimension #casesensitive');177 page.click('.extraction.0 .icon-minus');178 }, done);179 });180 it('should updated an existing dimension', function (done) {181 capturePageWrap('manage_edit_action_dimension_updated', function (page) {182 page.click('.editCustomDimension .update');183 }, done);184 });185 it('should have actually updated values', function (done) {186 capturePageWrap('manage_edit_action_dimension_verify_updated', function (page) {187 page.click('.manageCustomDimensions .customdimension.8 .icon-edit');188 }, done);189 });190 it('should go back to list when pressing cancel', function (done) {191 capturePageWrap('manage_edit_action_dimension_cancel', function (page) {192 page.click('.editCustomDimension .cancel');193 }, done);194 });195 it('should disable configure button when no dimensions are left for a scope', function (done) {196 capturePageWrap('manage_configure_button_disabled', function (page) {197 page.click('.configure.visit');198 page.click('.editCustomDimension #active');199 page.sendKeys(".editCustomDimension #name", 'Last Name');200 page.click('.editCustomDimension .create');201 }, done);202 });203 it('should be possible to create a new dimension via URL', function (done) {204 capturePageWrap('manage_create_via_url', function (page) {205 page.load(manageUrl + '#?idDimension=0&scope=action');206 }, done);207 });208 it('should be possible to open an existing visit dimension via URL', function (done) {209 capturePageWrap('manage_edit_via_url', function (page) {210 page.load(manageUrl + '#?idDimension=5&scope=action');211 }, done);212 });213 /**214 * VISIT DIMENSION REPORTS MENU GROUPED215 */216 it('should group dimensions in menu once there are more than 3', function (done) {217 captureSelector('report_visit_mainmenu_grouped', '#secondNavBar,.menuDropdown .items', function (page) {218 page.load(reportUrl + "&idDimension=2");219 page.click('#UserCountryMap_realtimeWorldMap + li .menuDropdown')220 }, done);221 });...

Full Screen

Full Screen

visual-tests.js

Source:visual-tests.js Github

copy

Full Screen

...12 const path = `test/puppeteer/screens/`13 await page.goto('https://limonte.github.io/sweetalert2/')14 switch (testCase) {15 case 'modal-type-success':16 await page.click('.showcase.sweet button')17 break18 case 'modal-type-question':19 await page.click('.title-text button')20 break21 case 'modal-type-error':22 await page.click('.error button')23 break24 case 'long-text':25 await page.click('#long-text button')26 break27 case 'input-type-text':28 await page.click('#input-text button')29 await page.type('.swal2-input', 'Hola!')30 break31 case 'input-type-email-invalid':32 await page.click('#input-email button')33 await page.type('.swal2-input', 'invalid email')34 await page.click('.swal2-confirm')35 break36 case 'input-type-email-valid':37 await page.click('#input-email button')38 await page.type('.swal2-input', 'email@example.com')39 await page.click('.swal2-confirm')40 break41 case 'input-type-url-invalid':42 await page.click('#input-url button')43 await page.type('.swal2-input', 'invalid URL')44 await page.click('.swal2-confirm')45 break46 case 'input-type-url-valid':47 await page.click('#input-url button')48 await page.type('.swal2-input', 'https://www.youtube.com/watch?v=PWgvGjAhvIw')49 await page.click('.swal2-confirm')50 break51 case 'input-type-password':52 await page.click('#input-password button')53 await page.type('.swal2-input', 'passw0rd')54 break55 case 'input-type-textarea':56 await page.click('#input-textarea button')57 break58 case 'input-type-select':59 await page.click('#input-select button')60 break61 case 'input-type-select-invalid':62 await page.click('#input-select button')63 await page.click('.swal2-confirm')64 break65 case 'input-type-select-valid':66 await page.click('#input-select button')67 await page.keyboard.press('ArrowDown')68 await page.keyboard.press('ArrowDown')69 await page.click('.swal2-confirm')70 break71 case 'input-type-radio':72 await page.click('#input-radio button')73 await page.waitFor(2000)74 break75 case 'input-type-radio-invalid':76 await page.click('#input-radio button')77 await page.waitFor(2000)78 await page.click('.swal2-confirm')79 break80 case 'input-type-radio-valid':81 await page.click('#input-radio button')82 await page.waitFor(2000)83 await page.keyboard.press('ArrowRight')84 await page.click('.swal2-confirm')85 break86 case 'input-type-checkbox':87 await page.click('#input-checkbox button')88 break89 case 'input-type-checkbox-invalid':90 await page.click('#input-checkbox button')91 await page.keyboard.press(' ')92 await page.click('.swal2-confirm')93 break94 case 'input-type-checkbox-valid':95 await page.click('#input-checkbox button')96 await page.click('.swal2-confirm')97 break98 case 'input-type-range':99 await page.click('#input-range button')100 break101 case 'ajax-request-reject':102 await page.click('#ajax-request button')103 await page.type('.swal2-input', 'taken@example.com')104 await page.click('.swal2-confirm')105 await page.waitFor(2100)106 break107 case 'ajax-request-success':108 await page.click('#ajax-request button')109 await page.type('.swal2-input', 'email@example.com')110 await page.click('.swal2-confirm')111 await page.waitFor(2000)112 break113 case 'chaining-modals-step1':114 await page.click('#chaining-modals button')115 break116 case 'chaining-modals-step2':117 await page.click('#chaining-modals button')118 await page.click('.swal2-confirm')119 break120 case 'chaining-modals-step3':121 await page.click('#chaining-modals button')122 await page.click('.swal2-confirm')123 await page.click('.swal2-confirm')124 break125 case 'chaining-modals-success':126 await page.click('#chaining-modals button')127 await page.type('.swal2-input', '1')128 await page.click('.swal2-confirm')129 await page.type('.swal2-input', '2')130 await page.click('.swal2-confirm')131 await page.type('.swal2-input', '3')132 await page.click('.swal2-confirm')133 break134 }135 await page.focus('.swal2-confirm')136 await page.hover('.swal2-modal')137 await page.waitFor(1200)138 const swalContainerHandle = await page.$('.swal2-container')139 await page.evaluate((swalContainer) => {140 swalContainer.style.padding = 0141 }, swalContainerHandle)142 const swalModalHandle = await page.$('.swal2-modal')143 const swalModalSize = await page.evaluate((swalModal) => {144 swalModal.style.borderRadius = 0145 return {146 width: swalModal.clientWidth,...

Full Screen

Full Screen

Nearby.e2e.js

Source:Nearby.e2e.js Github

copy

Full Screen

...12describe('Nearby Page Test', ()=>{13 it('search', async ()=>{14 await page.waitForSelector(".amap-maps", 'visible');15 await page.waitForSelector(".ant-input-search", 'visible');16 await page.click(".ant-input-search input");17 await page.type(".ant-input-search input", "复旦大学");18 await page.click(".ant-input-search .ant-btn-primary");19 await page.waitForSelector(".amap-zoomcontrol", 'visible');20 await page.click(".amap-zoomcontrol .amap-zoom-touch-minus");21 await page.click(".amap-zoomcontrol .amap-zoom-touch-minus");22 await page.waitFor(1500); //wait for 1.5s23 expect(await page.$$(".amap-marker")).toHaveLength(11);24 await page.waitForSelector(".amap-zoomcontrol", 'visible');25 await page.click(".amap-zoomcontrol .amap-zoom-touch-plus");26 await page.click(".amap-zoomcontrol .amap-zoom-touch-plus");27 await page.type(".ant-input-search input", "张江校区");28 await page.click(".ant-input-search .ant-btn-primary");29 await page.click(".amap-zoomcontrol .amap-zoom-touch-minus");30 await page.click(".amap-zoomcontrol .amap-zoom-touch-minus");31 await page.waitFor(1500); //wait for 1.5s32 expect(await page.$$(".amap-marker")).toHaveLength(11);33 })...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const qawolf = require("qawolf");2const selectors = require("./selectors/test.json");3describe('test', () => {4 let browser;5 let page;6 beforeAll(async () => {7 browser = await qawolf.launch();8 });9 beforeEach(async () => {10 page = await qawolf.createPage(browser);11 });12 afterAll(async () => {13 await browser.close();14 });15 afterEach(async () => {16 await qawolf.stopVideos();17 });18 test('test', async () => {19 await page.click(selectors["input[name='q']"]);20 await page.fill(selectors["input[name='q']"], "qawolf");21 await page.press(selectors["input[name='q']"], "Enter");22 });23});24{25}26{27 "dependencies": {28 },29 "devDependencies": {},30 "scripts": {31 },32}33 at CDPSession.send (C:\Users\sharath\Desktop\qawolf\node_modules\puppeteer\lib\Connection.js:200:56)34 at ExecutionContext.evaluateHandle (C:\Users\sharath\Desktop\qawolf\node_modules\puppeteer\lib\ExecutionContext.js:71:75)35 at ExecutionContext.evaluate (C:\Users\sharath\Desktop\qawolf\node_modules\puppeteer\lib\ExecutionContext.js:46:31)36 at DOMWorld.evaluate (C:\Users\sharath\Desktop\qawolf\node_modules\puppeteer\lib\DOMWorld.js:112:

Full Screen

Using AI Code Generation

copy

Full Screen

1const qawolf = require("qawolf");2const browser = await qawolf.launch();3const context = await browser.newContext();4const page = await context.newPage();5await page.click("button#gbqfbb");6const playwright = require('playwright');7const browser = await playwright.chromium.launch();8const context = await browser.newContext();9const page = await context.newPage();10await page.click('button#gbqfbb');11const puppeteer = require('puppeteer');12const browser = await puppeteer.launch();13const page = await browser.newPage();14await page.click('button#gbqfbb');15const {Builder, By, Key, until} = require('selenium-webdriver');16const driver = new Builder().forBrowser('chrome').build();17driver.findElement(By.css('button#gbqfbb')).click();18const {remote} = require('webdriverio');19const browser = await remote({20 capabilities: {21 }22});23await browser.click('button#gbqfbb');24describe('test', function() {25 it('test', function() {26 cy.get('button#gbqfbb').click();27 });28});29module.exports = {30 'test' : function (browser) {31 .waitForElementVisible('body', 1000)32 .click('button#gbqfbb')33 .end();34 }35};36test('test', async t => {37 .click('button#gbqfbb');38});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { launch } from 'qawolf';2import { test } from 'qawolf';3describe('test', () => {4 let browser;5 let page;6 beforeAll(async () => {7 browser = await launch();8 page = await browser.newPage();9 });10 afterAll(async () => {11 await browser.close();12 });13 it('test', async () => {14 await page.click('[name="q"]');15 await page.type('[name="q"]', 'qawolf');16 await page.click('[name="btnK"]');17 await page.waitForSelector('[data-async-context="query:qawolf"]');18 await page.click('[data-async-context="query:qawolf"]');19 await page.waitForSelector('.LC20lb');20 await page.click('.LC20lb');21 await page.waitForSelector('[data-async-context="query:qawolf"]');22 await page.click('[data-async-context="query:qawolf"]');23 await page.waitForSelector('.LC20lb');24 await page.click('.LC20lb');25 await page.waitForSelector('[data-async-context="query:qawolf"]');26 await page.click('[data-async-context="query:qawolf"]');27 await page.waitForSelector('.LC20lb');28 await page.click('.LC20lb');29 await page.waitForSelector('[data-async-context="query:qawolf"]');30 await page.click('[data-async-context="query:qawolf"]');31 await page.waitForSelector('.LC20lb');32 await page.click('.LC20lb');33 await page.waitForSelector('[data-async-context="query:qawolf"]');34 await page.click('[data-async-context="query:qawolf"]');35 await page.waitForSelector('.LC20lb');36 await page.click('.LC20lb');37 await page.waitForSelector('[data-async-context="query:qawolf"]');38 await page.click('[data-async-context="query:qawolf"]');39 await page.waitForSelector('.LC20lb');40 await page.click('.LC20lb');41 await page.waitForSelector('[data-async-context="query:qawolf"]');42 await page.click('[data-async-context="query:qawolf"]');43 await page.waitForSelector('.LC20lb');44 await page.click('.LC20lb');45 await page.waitForSelector('[data-async

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch } = require("qawolf");2const config = {3 launchOptions: {4 },5};6launch(config).then(async (browser) => {7 const page = await browser.newPage();8 await page.click("text=Example Domain");9 await page.click("text=More information...");

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch } = require("qawolf");2const selectors = require("./selectors/test.json");3const config = require("./config.json");4const test = async () => {5 const browser = await launch({ url: config.url });6 const page = await browser.page();7 await page.click(selectors["#search"]);8};9test();10{11 "#search": {12 }13}14{15}

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run qawolf automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful