Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wtto00 committed Sep 15, 2023
1 parent 3fc551b commit bad6d8d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/afterStart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ describe("after start a emulator", () => {
beforeAll(async () => {
const avds = await android.listAVDs();
let avdName = "";
console.log("avds.length", avds.length);

if (avds.length === 0) {
avdName = `TestCreate_${Math.random()}`;
avdName = `TestCreate_${Math.random().toString().substring(2)}`;
const images = (await android.listImages()).filter((item) => item.vendor === "default");
if (images.length === 0) return;
const image = images[images.length - 1].name;
console.log("image", image);

await android.createAVD({ name: avdName, package: image, force: false });
} else {
avdName = avds[0].Name;
}
const avds1 = await android.listAVDs();
console.log("avds", avds1);
const res = await android.start(avdName);
emulatorId = res.id;
if (emulatorId) {
Expand Down

0 comments on commit bad6d8d

Please sign in to comment.