mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
* feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Added basic example test for Blockly Playground and Blockly Demo * feat: Add functionality to run playground and block factory test locally * feat: Add functionality to run playground and block factory test locally * feat: Add functionality to run playground and block factory test locally * feat: Add functionality to run playground and block factory test locally * feat: Create procedure test * feat: Create procedure test * feat: Create procedure test * chore: test for procedures * chore: test for procedures * chore: test for procedures * chore: test for procedures * fix: Switch broswer_test.yaml to be macOS as to match local development evn * fix: Switch broswer_test.yaml to be macOS as to match local development evn * fix: Switch broswer_test.yaml to be macOS as to match local development evn * fix: Switch broswer_test.yaml to be macOS as to match local development evn * fix: Update browser test to run manually, and move browser test suiteSetup in to a separate function
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @fileoverview Node.js script to run Automated tests in Chrome, via webdriver.
|
|
*/
|
|
|
|
const chai = require('chai');
|
|
const {testSetup, testFileLocations} = require('./test_setup');
|
|
|
|
let browser;
|
|
suite('Testing Connecting Blocks', function (done) {
|
|
// Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test
|
|
this.timeout(0);
|
|
|
|
// Setup Selenium for all of the tests
|
|
suiteSetup(async function () {
|
|
browser = await testSetup(testFileLocations.blockfactory);
|
|
});
|
|
|
|
test('Testing Block Drag', async function () {
|
|
const startingBlock = await browser.$(
|
|
'#blockly > div > svg.blocklySvg > g > g.blocklyBlockCanvas > g:nth-child(2)'
|
|
);
|
|
const blocklyCanvas = await browser.$(
|
|
'#blockly > div > svg.blocklySvg > g > g.blocklyBlockCanvas'
|
|
);
|
|
const firstPostion = await blocklyCanvas.getAttribute('transform');
|
|
await startingBlock.dragAndDrop({x: 20, y: 20});
|
|
const secondPosition = await blocklyCanvas.getAttribute('transform');
|
|
chai.assert.notEqual(firstPostion, secondPosition);
|
|
});
|
|
|
|
// Teardown entire suite after test are done running
|
|
suiteTeardown(async function () {
|
|
await browser.deleteSession();
|
|
});
|
|
});
|