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 example demonstrates two methods of how to perform right-click actions on elements. | |
// Run this test suite against the following Ext JS example: | |
// http://examples.sencha.com/extjs/6.5.1/examples/classic/desktop/index.html | |
describe('Right Click', function() { | |
it('Should right-click on icon and show menu - Example 1', function() { | |
var driver = ST.defaultContext.driver; | |
// Pass in a locator (not a Ext Component Query, as WebDriver.io doesn't recognize them directly) | |
driver.rightClick('//span[text()="SystemStatus"]'); |
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
/** | |
* The main application class. An instance of this class is created by app.js when it | |
* calls Ext.application(). This is the ideal place to handle application launch and | |
* initialization details. | |
*/ | |
Ext.define('MyApp.Application', { | |
extend: 'Ext.app.Application', | |
requires: [ | |
'Ext.direct.AmfRemotingProvider' |
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
/* | |
Author: Dan Gallo | |
Date: June 2017 | |
Test URL: http://examples.sencha.com/ExtReact/6.5.0/kitchensink/#/grids/core_features/basic_grid | |
Purpose: This test suite for a WebDriver scenario can be used for demonstrating data-driven | |
testing capabilities. The test loops through the Excel file's worksheet and ensures | |
that data in the grid matches the Excel sheet. |
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
describe('Throwing errors', function() { | |
var user = { | |
getUser: function(id) { | |
// Do something | |
} | |
}; | |
it('Should throw a custom error message', function() { | |
spyOn(user, 'getUser').and.throwError('No user ID specified'); |
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
// Scenario URL: http://examples.sencha.com/extjs/6.6.0/examples/kitchensink/?classic#form-fileuploads | |
describe('File Upload', function() { | |
it('should select a file to upload', function() { | |
// Populate name field (required) | |
ST.textField('form[title="File Upload Form"] textfield[fieldLabel="Name"]') | |
.setValue('My Screenshot'); | |
// Find file upload field's HTML element (the actual HTML file upload field) | |
ST.element('form[title="File Upload Form"] filefield[name="photo-path"] => input[type="file"]') | |
.get('id') |
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
// Scenario URL: http://examples.sencha.com/extjs/6.5.3/examples/kitchensink/frame-index.html?classic#locking-grid | |
describe('Grid column tests', function() { | |
it('Should lock the Change column', function() { | |
var driver = ST.defaultContext.driver; | |
// This code moves the mouse over one of the column's headers which | |
// shows the trigger to display the column menu | |
ST.element('gridcolumn[text=Change] => .x-column-header-text-container') | |
.get('id') | |
.and(function() { |
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
describe("Read JSON file", function() { | |
it("should read the data", function(done) { | |
var fs = require('fs'); | |
var users; | |
// Go up 2 folder paths in hierarchy | |
contextPath = contextPath.substring(0, contextPath.lastIndexOf('/')); | |
fs.readFile(contextPath + '/test.json', 'utf8', function (err, data) { | |
if (err) { |
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
// Scenario URL: http://examples.sencha.com/extjs/6.5.3/examples/kitchensink/?classic#form-contact | |
describe('Check component and element classes', function() { | |
it('should check the class applied to a component configuration', function() { | |
// These examples reference an Ext JS component and check its configured classes | |
// Example 1 | |
ST.button('form-contact button[text="Contact Us"]') | |
.get('cls') | |
.and(function(future) { | |
expect(future.data.cls).toContain('contactBtn'); |
OlderNewer