Skip to content

Commit

Permalink
Merge pull request #1050 from Klantinteractie-Servicesysteem/PC-839-C…
Browse files Browse the repository at this point in the history
…ontactmoment-Search

PC-839: End to end tests for Search Person & Search Company
  • Loading branch information
felixcicatt authored Feb 11, 2025
2 parents e1e85d5 + 274fc52 commit 11fdc95
Show file tree
Hide file tree
Showing 5 changed files with 659 additions and 0 deletions.
76 changes: 76 additions & 0 deletions Kiss.Bff.EndToEndTest/ContactMomentSearch/Helpers/Locators.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kiss.Bff.EndToEndTest.ContactMomentSearch.Helpers
{
internal static class Locators
{

public static ILocator Personen_LastNameInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "Achternaam" });

public static ILocator Personen_BirthDateInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "Geboortedatum" });

public static ILocator PersonenFirst_SearchButton(this IPage page) =>
page.Locator("form").Filter(new () { HasText = "Achternaam Geboortedatum" }).GetByRole(AriaRole.Button);
public static ILocator PersonenSecond_SearchButton(this IPage page) =>
page.Locator("form").Filter(new() { HasText = "Postcode Huisnummer" }).GetByRole(AriaRole.Button);

public static ILocator PersonenThird_SearchButton(this IPage page) =>
page.Locator("form").Filter(new() { HasText = "Bsn Zoeken" }).GetByRole(AriaRole.Button);
public static ILocator Personen_PostCodeInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "postcode" });
public static ILocator Personen_HuisnummerInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "huisnummer" });

public static ILocator SearchAddressByPostalAndHuisNummer(this IPage page, string postcode, string huisNummer)
{
return page.GetByRole(AriaRole.Table).Locator($"tbody tr:has(td:nth-child(4):has-text(\"{postcode.Trim()}\"))" +
$":has(td:nth-child(3):has-text(\"{huisNummer.Trim()}\"))");
}
public static ILocator Company_BedrijfsnaamInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "Bedrijfsnaam" });

public static ILocator Company_KVKNumberInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "KVK-nummer" });

public static ILocator Company_PostcodeInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "Postcode" });

public static ILocator Company_HuisnummerInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "Huisnummer" });

public static ILocator Company_FirstSearchButton(this IPage page) =>
page.Locator("form").Filter(new() { HasText= "Bedrijfsnaam Zoeken" }).GetByRole(AriaRole.Button);


public static ILocator GetSearchResultsByPostcodeAndHuisnummer(this IPage page, string postcode, string huisnummer) =>
page.GetByRole(AriaRole.Table).Locator($"tbody tr:has(td:nth-child(4):has-text(\"{postcode.Trim()}\"))" +
$":has(td:nth-child(3):has-text(\"{huisnummer.Trim()}\"))");

public static ILocator PersonenBsnInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "bsn" });


public static ILocator Company_KvknummerInput(this IPage page) =>
page.GetByRole(AriaRole.Textbox, new() { Name = "KVK-nummer of vestigingsnummer" });

public static ILocator Company_KvknummerSearchButton(this IPage page) =>
page.Locator("form").Filter(new() { HasText = "KVK-nummer of" }).GetByRole(AriaRole.Button);

public static ILocator Company_PostcodeHuisnummerSearchButton(this IPage page) =>
page.Locator("form").Filter(new() { HasText = "Postcode Huisnummer Zoeken" }).GetByRole(AriaRole.Button);

public static ILocator SearchCompanyByPostalAndHuisNummer(this IPage page, string postcode, string huisNummer)
{
return page.GetByRole(AriaRole.Table).Locator($"tbody tr:has(td:nth-child(4):has-text(\"{postcode.Trim()} {huisNummer.Trim()}\"))");
}
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kiss.Bff.EndToEndTest.ContactMomentSearch.Helpers
{
internal static class ManageContactmoment
{
public static async Task CreateNewContactmomentAsync(this IPage page)
{
await page.GetByRole(AriaRole.Button, new() { Name = "Nieuw contactmoment" }).ClickAsync();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Kiss.Bff.EndToEndTest.ContactMomentSearch.Helpers
{
internal static class Navigation
{


}
}
Loading

0 comments on commit 11fdc95

Please sign in to comment.