Skip to content

Commit

Permalink
Test up to adding the menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Feb 9, 2024
1 parent 2c8c712 commit 805d1d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,21 @@ await context.FillInCodeMirrorEditorWithRetriesAsync(
await context.ClickReliablyOnByLinkTextAsync("ABOUT");
await AssertStepAndClickNextAsync("Managing the menu", "As you can see, you can easily access");
AssertStep("Managing the menu", "Click on the \"Main Menu\" link.");
return;
await context.ClickReliablyOnByLinkTextAsync("Main Menu");
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "Here you can see the menu's editor");
AssertStep("Managing the menu", "Let's add a menu item for the new article we created!");
await context.ClickReliablyOnAsync(By.XPath("//button[normalize-space() = 'Add Menu Item']"));
// The overlay on the overlay of the menu item type selector is strange, including that its text can't be
// highlighted in the browser. Its buttons can't be clicked with ClickReliablyAsync() so we need to do this.
AssertStep("Managing the menu", "You can choose between multiple types of menu items.");
var originalUri = context.GetCurrentUri();
context.Get(By.XPath($"//button[contains(@class, 'shepherd-button-primary') and not(@id)]")).Click();
context.DoWithRetriesOrFail(() => context.GetCurrentUri() != originalUri);
AssertStep("Managing the menu", "For now, let's go with the Link Menu Item one.");

// Adding a menu item
await context.ClickReliablyOnByLinkTextAsync("Add");
return;
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "");
await AssertStepAndClickNextAsync("Managing the menu", "");
Expand Down
10 changes: 6 additions & 4 deletions Lombiq.Walkthroughs/Assets/Scripts/walkthroughs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ jQuery(($) => {
},
{
title: 'Managing the menu',
text: 'Here you can see all the menu items.',
text: 'Here you can see the menu\'s editor, including all the menu items.',
attachTo: { element: '.edit-body', on: 'top' },
canClickTarget: false,
buttons: [
Expand All @@ -1135,7 +1135,7 @@ jQuery(($) => {
},
{
title: 'Managing the menu',
text: 'Let\'s add the new article that we created! Click on the <em>"Add Menu Item"</em> button.',
text: 'Let\'s add a menu item for the new article we created! Click on the <em>"Add Menu Item"</em> button.',
attachTo: { element: 'button[data-bs-target="#modalMenuItems"]', on: 'top' },
buttons: [
backButton,
Expand All @@ -1145,7 +1145,7 @@ jQuery(($) => {
},
{
title: 'Managing the menu',
text: 'You can choose between multiple menu items. Read the description too see how they ' +
text: 'You can choose between multiple types of menu items. Read the descriptions too see how they ' +
'are different.',
attachTo: { element: '.modal-body', on: 'top' },
canClickTarget: false,
Expand Down Expand Up @@ -1176,7 +1176,9 @@ jQuery(($) => {
},
{
title: 'Managing the menu',
text: 'For now let\'s go with the Link Menu Item one. Click on the <em>"Add"</em> button.',
text: '<p>For now, let\'s go with the Link Menu Item one. This can be used to easily add menu ' +
'items for content items.</p>' +
'<p>Click on the <em>"Add"</em> button.</p>',
attachTo: { element: 'a[href*="Create/LinkMenuItem"]', on: 'bottom' },
buttons: [
backButton,
Expand Down

0 comments on commit 805d1d8

Please sign in to comment.