From 70c5e9532a0c19d3a2f5299f5f72bdaa50918977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Cutzach?= Date: Tue, 27 Aug 2024 16:17:48 +0200 Subject: [PATCH] tests ADDED --- test/nbrowser/DocTypeConversion.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/nbrowser/DocTypeConversion.ts b/test/nbrowser/DocTypeConversion.ts index 27b48404..8ff925f2 100644 --- a/test/nbrowser/DocTypeConversion.ts +++ b/test/nbrowser/DocTypeConversion.ts @@ -24,12 +24,15 @@ describe("Document Type Conversion", function () { assert.isTrue(await editButton.visible()); } - async function convert(from:String, to:String) { + async function convert(from: String, to: String) { await gu.openDocumentSettings(); // Check that Document type is from before any conversion was ever apply to It. assert.equal(await displayedLabel.element().getText(), from); + // Click to open the modal + await editButton.click(); + // Wait for modal. await modal.wait(); @@ -55,7 +58,7 @@ describe("Document Type Conversion", function () { await modalConfirm.click(); // await for the page reload - await driver.navigate().refresh(); + await driver.sleep(200); // check that the displayedLabel is now equal to convert destination assert.equal(await displayedLabel.element().getText(), to); @@ -91,27 +94,27 @@ describe("Document Type Conversion", function () { // If the next six tests succeed so each document type can properly be converted to every other it('should convert from Regular to Template', async function() { - convert("Regular", "Template"); + await convert("Regular", "Template"); }); it('should convert from Template to Tutorial', async function() { - convert("Template", "Tutorial"); + await convert("Template", "Tutorial"); }); it('should convert from Tutorial to Regular', async function() { - convert("Tutorial", "Regular"); + await convert("Tutorial", "Regular"); }); it('should convert from Regular to Tutorial', async function() { - convert("Regular", "Tutorial"); + await convert("Regular", "Tutorial"); }); it('should convert from Tutorial to Template', async function() { - convert("Tutorial", "Template"); + await convert("Tutorial", "Template"); }); it('should convert from Template to Regular', async function() { - convert("Template", "Regular"); + await convert("Template", "Regular"); }); it('should be disabled for non-owners', async function() {