mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Add level 50 Pokemon test for VGC (#964)
This commit is contained in:
parent
2eade6fdf5
commit
cfd87a91c1
|
|
@ -8,7 +8,7 @@ addons:
|
|||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- google-chrome-stable fluxbox
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
|
@ -18,4 +18,5 @@ before_script:
|
|||
- "sh -e /etc/init.d/xvfb start"
|
||||
script:
|
||||
- "npm test"
|
||||
- "fluxbox >/dev/null 2>&1 &"
|
||||
- "npm run-script testcafe"
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.0.7",
|
||||
"eslint": "^3.2.2",
|
||||
"testcafe": "^0.16.1"
|
||||
},
|
||||
|
|
|
|||
26
test/test.ts
26
test/test.ts
|
|
@ -1,7 +1,19 @@
|
|||
import { Selector } from 'testcafe';
|
||||
import { execFile } from 'child_process';
|
||||
|
||||
const showdownDirectory = __dirname + '/../data/Pokemon-Showdown';
|
||||
|
||||
fixture('Pokemon Showdown')
|
||||
.page('../testclient.html?~~localhost');
|
||||
.page('../testclient.html?~~localhost')
|
||||
.before(async ctx => {
|
||||
ctx.process = execFile(showdownDirectory + '/pokemon-showdown', {
|
||||
cwd: showdownDirectory,
|
||||
});
|
||||
})
|
||||
.after(async ctx => {
|
||||
ctx.process.kill();
|
||||
})
|
||||
.beforeEach(t => t.maximizeWindow());
|
||||
|
||||
const expectedTeam = `=== Untitled 1 ===
|
||||
|
||||
|
|
@ -20,3 +32,15 @@ test('Teambuilder works', async t => {
|
|||
|
||||
await t.expect((await Selector('textarea').value).trim()).eql(expectedTeam);
|
||||
});
|
||||
|
||||
test('Teambuilder shows level 50 for VGC', async t => {
|
||||
await t.click('[name="close"]')
|
||||
.click('[value="teambuilder"]')
|
||||
.click('[name="newTop"]')
|
||||
.click('.teambuilderformatselect')
|
||||
.click('[value^="gen7vgc"]')
|
||||
.click('[name="addPokemon"]')
|
||||
.click('[data-entry="pokemon|Absol"]')
|
||||
.click('.setdetails')
|
||||
.expect(Selector('[name="level"]').value).eql('50');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user