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
// WebDriver scenario URL: https://examples.sencha.com/extjs/6.7.0/examples/kitchensink/frame-index.html#link-buttons | |
describe('Switching tabs', function() { | |
var tabIds, driver; | |
beforeAll(function() { | |
// This stores a reference to the underlying driver object | |
driver = ST.defaultContext.driver; | |
}); | |
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#array-grid | |
describe('Grid', function() { | |
it('should click a button on a grid row and check the popup message contains the clicked record name', function() { | |
var recordName; | |
// Locate the grid | |
ST.grid('array-grid') | |
.rowAt(2) | |
.getRecord() | |
.and(function(future) { |
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#array-grid | |
describe('Grid', function() { | |
var recordTitle; | |
it('should get the cell text content', function() { | |
// Use the "getRecord" API to get a record's value | |
ST.grid('grid[title="Basic Grid"]') | |
.rowAt(1) | |
.getRecord() |
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'); |
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/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
// 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
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
/* | |
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
/** | |
* 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' |
NewerOlder