Skip to content

Commit

Permalink
test(e2e): retry flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Aug 6, 2023
1 parent 4b59387 commit 5abd76a
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 32 deletions.
50 changes: 43 additions & 7 deletions e2e/datachannel/serialization_binary.spec.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,71 @@
import P from "./serialization.page.js";
import { serializationTest } from "./serializationTest.js";
describe("DataChannel:Binary", () => {
beforeAll(async () => {
await P.init();
});
it("should transfer numbers", serializationTest("./numbers", "binary"));
it("should transfer strings", serializationTest("./strings", "binary"));
beforeAll(
async () => {
await P.init();
},
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer numbers",
serializationTest("./numbers", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer strings",
serializationTest("./strings", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer long string",
serializationTest("./long_string", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer objects",
serializationTest("./objects", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer arrays",
serializationTest("./arrays", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it("should transfer objects", serializationTest("./objects", "binary"));
it("should transfer arrays", serializationTest("./arrays", "binary"));
it(
"should transfer Dates as strings",
serializationTest("./dates_as_string", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer ArrayBuffers",
serializationTest("./arraybuffers", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer TypedArrayView as ArrayBuffer",
serializationTest("./TypedArrayView_as_ArrayBuffer", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer Uint8Arrays as ArrayBuffer",
serializationTest("./Uint8Array_as_ArrayBuffer", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer Int32Arrays as ArrayBuffer",
serializationTest("./Int32Array_as_ArrayBuffer", "binary"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
});
35 changes: 29 additions & 6 deletions e2e/datachannel/serialization_json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,43 @@ import P from "./serialization.page.js";
import { serializationTest } from "./serializationTest.js";

describe("DataChannel:JSON", () => {
beforeAll(async () => {
await P.init();
});
it("should transfer numbers", serializationTest("./numbers", "json"));
it("should transfer strings", serializationTest("./strings", "json"));
beforeAll(
async () => {
await P.init();
},
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer numbers",
serializationTest("./numbers", "json"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer strings",
serializationTest("./strings", "json"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
// it("should transfer long string", serializationTest("./long_string", "json"));
it("should transfer objects", serializationTest("./objects", "json"));
it(
"should transfer objects",
serializationTest("./objects", "json"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer arrays (no chunks)",
serializationTest("./arrays_unchunked", "json"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
it(
"should transfer Dates as strings",
serializationTest("./dates_as_json_string", "json"),
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
// it("should transfer ArrayBuffers", serializationTest("./arraybuffers", "json"));
// it("should transfer TypedArrayView", serializationTest("./typed_array_view", "json"));
Expand Down
47 changes: 28 additions & 19 deletions e2e/mediachannel/close.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@ import P from "./close.page.js";
import { browser } from "@wdio/globals";

describe("MediaStream", () => {
beforeAll(async () => {
await P.init();
});
fit("should close the remote stream", async () => {
await P.open();
await P.waitForMessage("Your Peer ID: ");
const bobId = (await P.messages.getText()).split("Your Peer ID: ")[1];
await browser.switchWindow("Alice");
await P.waitForMessage("Your Peer ID: ");
await P.receiverId.setValue(bobId);
await P.callBtn.click();
await P.waitForMessage("Connected!");
await browser.switchWindow("Bob");
await P.waitForMessage("Connected!");
await P.closeBtn.click();
await P.waitForMessage("Closed!");
await browser.switchWindow("Alice");
await P.waitForMessage("Closed!");
});
beforeAll(
async () => {
await P.init();
},
jasmine.DEFAULT_TIMEOUT_INTERVAL,
1,
);
it(
"should close the remote stream",
async () => {
await P.open();
await P.waitForMessage("Your Peer ID: ");
const bobId = (await P.messages.getText()).split("Your Peer ID: ")[1];
await browser.switchWindow("Alice");
await P.waitForMessage("Your Peer ID: ");
await P.receiverId.setValue(bobId);
await P.callBtn.click();
await P.waitForMessage("Connected!");
await browser.switchWindow("Bob");
await P.waitForMessage("Connected!");
await P.closeBtn.click();
await P.waitForMessage("Closed!");
await browser.switchWindow("Alice");
await P.waitForMessage("Closed!");
},
jasmine.DEFAULT_TIMEOUT_INTERVAL,
2,
);
});

0 comments on commit 5abd76a

Please sign in to comment.