Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Raczek committed Dec 2, 2024
1 parent 682e720 commit df114ab
Show file tree
Hide file tree
Showing 9 changed files with 335 additions and 120 deletions.
2 changes: 1 addition & 1 deletion Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="NLog" Version="5.3.4" />


<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Runners" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
33 changes: 11 additions & 22 deletions Ocaramba.Tests.Angular/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@
},
"NUnit": {
"type": "Direct",
"requested": "[3.13.3, )",
"resolved": "3.13.3",
"contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ=="
"requested": "[4.2.2, )",
"resolved": "4.2.2",
"contentHash": "mon0OPko28yZ/foVXrhiUvq1LReaGsBdziumyyYGxV/pOE4q92fuYeN+AF+gEU5pCjzykcdBt5l7xobTaiBjsg==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Threading.Tasks.Extensions": "4.5.4",
"System.ValueTuple": "4.5.0"
}
},
"NUnit.Runners": {
"type": "Direct",
Expand Down Expand Up @@ -256,12 +261,9 @@
},
"NUnit": {
"type": "Direct",
"requested": "[3.13.3, )",
"resolved": "3.13.3",
"contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ==",
"dependencies": {
"NETStandard.Library": "2.0.0"
}
"requested": "[4.2.2, )",
"resolved": "4.2.2",
"contentHash": "mon0OPko28yZ/foVXrhiUvq1LReaGsBdziumyyYGxV/pOE4q92fuYeN+AF+gEU5pCjzykcdBt5l7xobTaiBjsg=="
},
"NUnit.Runners": {
"type": "Direct",
Expand Down Expand Up @@ -525,11 +527,6 @@
"resolved": "3.0.0",
"contentHash": "uwMyWN33+iQ8Wm/n1yoPXgFoiYNd0HzJyoqSVhaQZyJfaQrJR3udgcIHjqa1qbc3lS6kvfuUMN4TrF4U4refCQ=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"Microsoft.PowerShell.Commands.Diagnostics": {
"type": "Transitive",
"resolved": "7.4.6",
Expand Down Expand Up @@ -726,14 +723,6 @@
"resolved": "7.4.6",
"contentHash": "pnNVcVUT+CP7r23Ju/+nhp0fLSdwevAZwe3qe8XQEahYOUv9ACIP29GijRsjdOwIL8+7DaLUQF5jjh+P/ZjGTQ=="
},
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />


<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Runners" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
33 changes: 11 additions & 22 deletions Ocaramba.Tests.CloudProviderCrossBrowser/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
},
"NUnit": {
"type": "Direct",
"requested": "[3.13.3, )",
"resolved": "3.13.3",
"contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ=="
"requested": "[4.2.2, )",
"resolved": "4.2.2",
"contentHash": "mon0OPko28yZ/foVXrhiUvq1LReaGsBdziumyyYGxV/pOE4q92fuYeN+AF+gEU5pCjzykcdBt5l7xobTaiBjsg==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Threading.Tasks.Extensions": "4.5.4",
"System.ValueTuple": "4.5.0"
}
},
"NUnit.Runners": {
"type": "Direct",
Expand Down Expand Up @@ -238,12 +243,9 @@
},
"NUnit": {
"type": "Direct",
"requested": "[3.13.3, )",
"resolved": "3.13.3",
"contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ==",
"dependencies": {
"NETStandard.Library": "2.0.0"
}
"requested": "[4.2.2, )",
"resolved": "4.2.2",
"contentHash": "mon0OPko28yZ/foVXrhiUvq1LReaGsBdziumyyYGxV/pOE4q92fuYeN+AF+gEU5pCjzykcdBt5l7xobTaiBjsg=="
},
"NUnit.Runners": {
"type": "Direct",
Expand Down Expand Up @@ -507,11 +509,6 @@
"resolved": "3.0.0",
"contentHash": "uwMyWN33+iQ8Wm/n1yoPXgFoiYNd0HzJyoqSVhaQZyJfaQrJR3udgcIHjqa1qbc3lS6kvfuUMN4TrF4U4refCQ=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"Microsoft.PowerShell.Commands.Diagnostics": {
"type": "Transitive",
"resolved": "7.4.6",
Expand Down Expand Up @@ -708,14 +705,6 @@
"resolved": "7.4.6",
"contentHash": "pnNVcVUT+CP7r23Ju/+nhp0fLSdwevAZwe3qe8XQEahYOUv9ACIP29GijRsjdOwIL8+7DaLUQF5jjh+P/ZjGTQ=="
},
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.12.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NPOI" Version="2.7.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Runners" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -19,6 +19,7 @@
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="131.0.6778.8500" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.35.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
Expand Down
29 changes: 14 additions & 15 deletions Ocaramba.Tests.NUnitExtentReports/Tests/HerokuappTestsNUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ public void BasicAuthTest()
Verify.That(
this.DriverContext,
() =>
Assert.AreEqual(
ExpectedCongratulationsInfo,
basicAuthPage.GetCongratulationsInfo));
Assert.That(basicAuthPage.GetCongratulationsInfo, Is.EqualTo(ExpectedCongratulationsInfo)));
}

[Test]
Expand All @@ -61,10 +59,10 @@ public void MultipleWindowsTest()
.OpenNewWindowPage();

test.Info("Verifying page title, expected: " + PageTitle);
Assert.True(newWindowPage.IsPageTile(PageTitle), "wrong page title, should be {0}", PageTitle);
Assert.That(newWindowPage.IsPageTile(PageTitle), Is.True, "wrong page title, should be {0}", PageTitle);

test.Info("Verifying H3 header text displayd on te page, expected: " + PageTitle);
Assert.True(newWindowPage.IsNewWindowH3TextVisible(PageTitle), "text is not equal to {0}", PageTitle);
Assert.That(newWindowPage.IsNewWindowH3TextVisible(PageTitle), Is.True, "text is not equal to {0}", PageTitle);
}

[Test]
Expand All @@ -83,22 +81,22 @@ public void NestedFramesTest()
nestedFramesPage.SwitchToFrame("frame-left");

test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText);
Assert.AreEqual(ExpectedLeftFrameText, nestedFramesPage.LeftBody);
Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText));

nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle");

test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText);
Assert.AreEqual(ExpectedMiddleFrameText, nestedFramesPage.MiddleBody);
Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText));

nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-right");

test.Info("Verifying text displayed in right frame, expected: " + ExpectedRightFrameText);
Assert.AreEqual(ExpectedRightFrameText, nestedFramesPage.RightBody);
Assert.That(nestedFramesPage.RightBody, Is.EqualTo(ExpectedRightFrameText));

nestedFramesPage.ReturnToDefaultContent().SwitchToFrame("frame-bottom");

test.Info("Verifying text displayed in bottom frame, expected: " + ExpectedBottomFrameText);
Assert.AreEqual(ExpectedBottomFrameText, nestedFramesPage.BottomBody);
Assert.That(nestedFramesPage.BottomBody, Is.EqualTo(ExpectedBottomFrameText));
}

[Test]
Expand All @@ -115,7 +113,8 @@ public void SetAttributeTest()
var brokenImagesPage = new BrokenImagesPage(this.DriverContext);

test.Info("Verifying page header, expected: " + PageHeader);
Assert.True(brokenImagesPage.IsPageHeaderElementEqualsToExpected(PageHeader), "Page header element is not equal to expected " + PageHeader);
Assert.That(brokenImagesPage.IsPageHeaderElementEqualsToExpected(PageHeader),
Is.True, "Page header element is not equal to expected " + PageHeader);
}

[Test]
Expand All @@ -130,10 +129,10 @@ public void TablesTest()
var table = tableElements.GetTableElements();

test.Info("Verifying surname displayed in the table, expected: " + ExpectedSurname);
Assert.AreEqual(ExpectedSurname, table[0][0]);
Assert.That(table[0][0], Is.EqualTo(ExpectedSurname));

test.Info("Verifying action links displayed in the table, expected: " + ExpectedActionLinks);
Assert.AreEqual(ExpectedActionLinks, table[3][5]);
Assert.That(table[3][5], Is.EqualTo(ExpectedActionLinks));
}

[Test]
Expand All @@ -145,7 +144,7 @@ public void DragAndDropTest()
.MoveElementAtoElementB();

test.Info("Verifying element A was moved to element B");
Assert.IsTrue(dragAndDrop.IsElementAMovedToB(), "Element is not moved.");
Assert.That(dragAndDrop.IsElementAMovedToB(), Is.True, "Element is not moved.");
}

[Test]
Expand All @@ -162,12 +161,12 @@ public void ReportDemoFailingTest()
nestedFramesPage.SwitchToFrame("frame-left");

test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText);
Assert.AreEqual(ExpectedLeftFrameText, nestedFramesPage.LeftBody);
Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText));

nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle");

test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText);
Assert.AreEqual(ExpectedMiddleFrameText, nestedFramesPage.MiddleBody);
Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText));
}
}
}
Loading

0 comments on commit df114ab

Please sign in to comment.