mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-25 16:14:01 -05:00
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { Selector } from 'testcafe';
|
|
import { execFile } from 'child_process';
|
|
|
|
const showdownDirectory = __dirname + '/../data/Pokemon-Showdown';
|
|
|
|
fixture('Pokemon Showdown')
|
|
.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 ===
|
|
|
|
Abomasnow-Mega @ Abomasite\x20\x20
|
|
Ability: Snow Warning`;
|
|
|
|
test('Teambuilder works', async t => {
|
|
await t.click('[name="close"]')
|
|
.click('[value="teambuilder"]')
|
|
.click('[name="newTop"]')
|
|
.click('[name="addPokemon"]')
|
|
.click('[data-entry="pokemon|Abomasnow-Mega"]')
|
|
.click('[name="back"]')
|
|
.click('[name="back"]')
|
|
.click('[name="backup"]');
|
|
|
|
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');
|
|
});
|