Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Aug 23, 2024
1 parent 253e989 commit 20b2b3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ void AssertStep(string header, string text, bool assertShepherdTargetIsNotBody =

Task ClickShepherdTargetAsync() => context.ClickReliablyOnUntilUrlChangeAsync(_byShepherdTarget);

Task ClickShepherdTargetWithScriptAsync() =>
context.RetryIfNotStaleOrFailAsync(() =>
{
context.ExecuteScript($"document.querySelector('.{_shepherdTargetClass}').click()");
return Task.FromResult(context.Exists(_byShepherdTarget.Safely()));
});

Task FillInShepherdTargetWithRetriesAsync(string text) => context.FillInWithRetriesAsync(_byShepherdTarget, text);

// Just a selector on .shepherd-button-primary is not enough to find the button for some reason.
Expand Down Expand Up @@ -293,8 +286,7 @@ await AssertStepAndClickNextAsync(
await ClickOnNextButtonAsync();
await AssertStepAndClickNextAsync("Taxonomies", "And you can set a permalink for it");
await AssertStepAndClickShepherdTargetAsync("Taxonomies", "Let's publish the new category! ");
AssertStep("Taxonomies", "Your category is now published.");
await ClickShepherdTargetWithScriptAsync();
await AssertStepAndClickShepherdTargetAsync("Taxonomies", "Your category is now published.");
});

// Media management
Expand Down Expand Up @@ -398,8 +390,7 @@ await AssertStepAndFillInShepherdTargetAndClickNextAsync(
await AssertStepAndClickNextAsync("Content type editor", "You can select the editor type here.");
await AssertStepAndClickNextAsync("Content type editor", "You can also select the display mode here.");
await AssertStepAndClickShepherdTargetAsync("Content type editor", "Okay, now save it.");
AssertStep("Content type editor", "The text field is now saved. You will also");
await ClickShepherdTargetWithScriptAsync();
await AssertStepAndClickShepherdTargetAsync("Content type editor", "The text field is now saved. You will also");
await AssertStepAndClickNextAsync(
"Content type editor", "Congratulations, you just tinkered", assertShepherdTargetIsNotBody: false);
});
Expand Down
11 changes: 0 additions & 11 deletions Lombiq.Walkthroughs/Assets/Scripts/walkthroughs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
jQuery(($) => {
(function LoadShepherd(Shepherd) {
function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

function getCookieValue(cookieName) {
const name = cookieName + '=';
const cookieArray = document.cookie.split(';').map((cookie) => cookie.trim());
Expand Down Expand Up @@ -1925,13 +1921,6 @@ jQuery(($) => {
element: '.widget-editor-btn-toggle.widget-editor-btn-expand',
on: 'top',
},
beforeShowPromise: async () => {
// Wait up to 2 seconds for the element to appear.
for (let i = 0; i < 10; i++) {
if (document.querySelector('.widget-editor-btn-toggle.widget-editor-btn-expand')) return;
await delay(200);
}
},
buttons: [
backButton,
],
Expand Down

0 comments on commit 20b2b3d

Please sign in to comment.