diff --git a/README.md b/README.md index dff39ba..012dd61 100644 --- a/README.md +++ b/README.md @@ -94,11 +94,7 @@ You can click on buttons, click on links, fill in forms, and do many other thing ### Generating Assertions in the Browser -#### Method 1: -If you want to add an assertion that some content exists on the page, simply highlight some text and press ControlShift + A. You should see a confirm dialog asking for if you want to move forward with the assertion or cancel. - -#### Method 2: -You can now generate assertions by selecting your text and right-clicking with your mouse or touchpad. +If you want to add an assertion that some content exists on the page, simply highlight some text and right click or press ControlShift + A. You should see a confirm dialog asking for if you want to move forward with the assertion or cancel. ### Flushing In-Browser Actions and Assertions to the Test File diff --git a/app/views/magic_test/_context_menu.html.erb b/app/views/magic_test/_context_menu.html.erb index 4e8ba3f..fcf1e78 100644 --- a/app/views/magic_test/_context_menu.html.erb +++ b/app/views/magic_test/_context_menu.html.erb @@ -33,7 +33,7 @@ }); function enableKeyboardShortcuts() { - // Ctrl+A to generate an assertion. + // Ctrl+Shift+A to generate an assertion. function keydown(event) { if (event.ctrlKey && event.shiftKey && event.key === 'A') { event.preventDefault(); diff --git a/app/views/magic_test/_mutation_observer.html b/app/views/magic_test/_mutation_observer.html index ea85bfd..30ab80a 100644 --- a/app/views/magic_test/_mutation_observer.html +++ b/app/views/magic_test/_mutation_observer.html @@ -6,14 +6,15 @@ console.log("There is no window.target element. Quitting the mutation callback function."); return; } - var options = ""; - var targetClass = window.target.classList[0] ? `.${window.target.classList[0]}` : ""; - var text = window.target.innerText ? `', text: '${window.target.innerText}` : ""; - var action = `${finderForElement(window.target)}.hover`; + + // TODO: Remove this if we don't need it. + // var targetClass = window.target.classList[0] ? `.${window.target.classList[0]}` : "" + // var text = window.target.innerText ? `', text: '${window.target.innerText}` : "" // var action = `find('${window.target.localName}${targetClass}${text}').hover`; - var target = ""; + + var action = `${finderForElement(window.target)}.hover`; var testingOutput = JSON.parse(sessionStorage.getItem("testingOutput")); - testingOutput.push({action: action, target: target, options: options}); + testingOutput.push({action: action, target: "", options: ""}); sessionStorage.setItem("testingOutput", JSON.stringify(testingOutput)); }); }