testing groups

pull/1754/head
bunsenstraat 3 years ago
parent ef00058c5f
commit 263d83b229
  1. 28
      apps/remix-ide-e2e/src/buildGroupTests.js
  2. 2
      apps/remix-ide-e2e/src/tests/debugger.spec.ts_group1.spec.ts
  3. 14
      apps/remix-ide-e2e/src/tests/editor.spec.ts
  4. 6
      apps/remix-ide-e2e/src/tests/editor.spec.ts_group1.spec.ts
  5. 4
      apps/remix-ide-e2e/src/tests/editor.spec.ts_group2.spec.ts
  6. 22
      apps/remix-ide-e2e/src/tests/generalSettings.test.ts
  7. 6
      apps/remix-ide-e2e/src/tests/generalSettings.test.ts_group1.test.ts
  8. 6
      apps/remix-ide-e2e/src/tests/generalSettings.test.ts_group2.test.ts

@ -1,6 +1,32 @@
const testFolder = './apps/remix-ide-e2e/src/tests/'
const fs = require('fs')
const path = require('path')
const source = `'use strict'
import * as test from './#file'
import buildGroupTest from '../helpers/buildgrouptest'
const group = '#groupname'
module.exports = buildGroupTest(group, test)`
fs.readdirSync(testFolder).forEach(file => {
console.log(file)
if (!file.includes('group')) {
const content = fs.readFileSync(testFolder + file, 'utf8')
let matches = content.match(/group\d+/g)
if (matches) {
const unique = matches.filter(onlyUnique);
unique.map((group) => {
const rewrite = source.replace('#groupname', group).replace('#file', file.replace('.ts', ''))
const extension = file.split('.')
extension.shift()
const filename = `${testFolder}${file}_${group}.${extension.join('.')}`
fs.writeFileSync(filename, rewrite)
})
}
}
})
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}

@ -3,4 +3,4 @@ import * as test from './debugger.spec'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group1'
module.exports = buildGroupTest(group, test)
module.exports = buildGroupTest(group, test)

@ -9,7 +9,7 @@ module.exports = {
init(browser, done)
},
'Should zoom in editor': function (browser: NightwatchBrowser) {
'Should zoom in editor #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('div[data-id="mainPanelPluginsContainer"]')
.clickLaunchIcon('filePanel')
.waitForElementVisible('div[data-id="filePanelFileExplorerTree"]')
@ -22,7 +22,7 @@ module.exports = {
.checkElementStyle('.view-lines', 'font-size', '16px')
},
'Should zoom out editor': function (browser: NightwatchBrowser) {
'Should zoom out editor #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.checkElementStyle('.view-lines', 'font-size', '16px')
.click('*[data-id="tabProxyZoomOut"]')
@ -30,7 +30,7 @@ module.exports = {
.checkElementStyle('.view-lines', 'font-size', '14px')
},
'Should display compile error in editor': function (browser: NightwatchBrowser) {
'Should display compile error in editor #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.setEditorValue(storageContractWithError + 'error')
.pause(2000)
@ -42,7 +42,7 @@ module.exports = {
.checkAnnotations('fa-exclamation-square', 29) // error
},
'Should minimize and maximize codeblock in editor': '' + function (browser: NightwatchBrowser) {
'Should minimize and maximize codeblock in editor #group1': '' + function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.waitForElementVisible('.ace_open')
.click('.ace_start:nth-of-type(1)')
@ -51,7 +51,7 @@ module.exports = {
.waitForElementVisible('.ace_open')
},
'Should add breakpoint to editor': function (browser: NightwatchBrowser) {
'Should add breakpoint to editor #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView')
.waitForElementNotPresent('.margin-view-overlays .fa-circle')
.execute(() => {
@ -83,7 +83,7 @@ module.exports = {
*/
},
'Should highlight source code': function (browser: NightwatchBrowser) {
'Should highlight source code #group2': function (browser: NightwatchBrowser) {
// include all files here because switching between plugins in side-panel removes highlight
browser
.addFile('sourcehighlight.js', sourcehighlightScript)
@ -115,7 +115,7 @@ module.exports = {
.checkElementStyle('.highlightLine51', 'background-color', 'rgb(52, 152, 219)')
},
'Should remove all highlights from source code': function (browser: NightwatchBrowser) {
'Should remove all highlights from source code #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.click('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]')
.pause(2000)

@ -0,0 +1,6 @@
'use strict'
import * as test from './editor.spec'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group1'
module.exports = buildGroupTest(group, test)

@ -1,6 +1,6 @@
'use strict'
import * as test from './debugger.spec'
import * as test from './editor.spec'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group2'
module.exports = buildGroupTest(group, test)
module.exports = buildGroupTest(group, test)

@ -7,7 +7,7 @@ module.exports = {
init(browser, done, 'http://127.0.0.1:8080', false)
},
'Should display settings menu': function (browser: NightwatchBrowser) {
'Should display settings menu #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
@ -15,7 +15,7 @@ module.exports = {
.waitForElementContainsText('h6[data-id="sidePanelSwapitTitle"]', 'SETTINGS')
},
'Should activate `generate contract metadata`': function (browser) {
'Should activate `generate contract metadata` #group1': function (browser) {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000)
.waitForElementVisible('*[data-id="settingsTabGenerateContractMetadataLabel"]', 5000)
.verify.elementPresent('[data-id="settingsTabGenerateContractMetadata"]:checked')
@ -35,7 +35,7 @@ module.exports = {
})
},
'Should add new github access token': function (browser: NightwatchBrowser) {
'Should add new github access token #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="verticalIconsKindsettings"]')
.setValue('*[data-id="settingsTabGistAccessToken"]', '**********')
@ -45,7 +45,7 @@ module.exports = {
.pause(3000)
},
'Should copy github access token to clipboard': function (browser: NightwatchBrowser) {
'Should copy github access token to clipboard #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="copyToClipboardCopyIcon"]')
.waitForElementVisible('*[data-shared="tooltipPopup"]', 5000)
@ -54,7 +54,7 @@ module.exports = {
// .assert.containsText('*[data-shared="tooltipPopup"]:nth-last-of-type(1)', 'Copied value to clipboard.')
},
'Should remove github access token': function (browser: NightwatchBrowser) {
'Should remove github access token #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.pause(1000)
.click('*[data-id="settingsTabRemoveGistToken"]')
@ -63,7 +63,7 @@ module.exports = {
.assert.containsText('*[data-id="settingsTabGistAccessToken"]', '')
},
'Should load dark theme': function (browser: NightwatchBrowser) {
'Should load dark theme #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelDark"]')
.pause(2000)
@ -75,7 +75,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.dark.danger)
},
'Should load light theme': function (browser: NightwatchBrowser) {
'Should load light theme #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelLight"]')
.pause(2000)
@ -87,7 +87,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.light.danger)
},
'Should load Cerulean theme': function (browser: NightwatchBrowser) {
'Should load Cerulean theme #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelCerulean"]')
.pause(5000)
@ -99,7 +99,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.curelean.danger)
},
'Should load Flatly theme': function (browser: NightwatchBrowser) {
'Should load Flatly theme #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelFlatly"]')
.pause(2000)
@ -111,7 +111,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.flatly.danger)
},
'Should load Spacelab theme': function (browser) {
'Should load Spacelab theme #group2': function (browser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelSpacelab"]')
.pause(2000)
@ -123,7 +123,7 @@ module.exports = {
.checkElementStyle(':root', '--danger', remixIdeThemes.spacelab.danger)
},
'Should load Cyborg theme': function (browser) {
'Should load Cyborg theme #group2': function (browser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
.click('*[data-id="settingsTabThemeLabelCyborg"]')
.pause(2000)

@ -0,0 +1,6 @@
'use strict'
import * as test from './generalSettings.test'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group1'
module.exports = buildGroupTest(group, test)

@ -0,0 +1,6 @@
'use strict'
import * as test from './generalSettings.test'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group2'
module.exports = buildGroupTest(group, test)
Loading…
Cancel
Save