Replace .first() with localize (#11341)

Replaced usage of first() with localize to target specific action in context menu
This commit is contained in:
Matt Darby
2021-11-15 23:25:04 +00:00
committed by GitHub
parent cabc30341a
commit 0a626c6c2a
4 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ context('Media Types', () => {
cy.umbracoTreeItem("settings", ["Media Types"]).rightclick(); cy.umbracoTreeItem("settings", ["Media Types"]).rightclick();
cy.umbracoContextMenuAction("action-create").click(); cy.umbracoContextMenuAction("action-create").click();
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click(); cy.get('.menu-label localize[key="content_mediatype"]').click();
//Type name //Type name

View File

@@ -29,7 +29,7 @@ context('Partial View Macro Files', () => {
openPartialViewMacroCreatePanel(); openPartialViewMacroCreatePanel();
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-label").click(); cy.get('.menu-label localize[key="create_newPartialViewMacro"]').click();
//Type name //Type name
cy.umbracoEditorHeaderName(name); cy.umbracoEditorHeaderName(name);

View File

@@ -26,7 +26,7 @@ context('Partial Views', () => {
openPartialViewsCreatePanel(); openPartialViewsCreatePanel();
cy.umbracoContextMenuAction("action-create").click(); cy.umbracoContextMenuAction("action-create").click();
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click(); cy.get('.menu-label localize[key="create_newEmptyPartialView"]').click();
//Type name //Type name
cy.umbracoEditorHeaderName(name); cy.umbracoEditorHeaderName(name);
@@ -73,7 +73,7 @@ context('Partial Views', () => {
openPartialViewsCreatePanel(); openPartialViewsCreatePanel();
cy.umbracoContextMenuAction("action-create").click(); cy.umbracoContextMenuAction("action-create").click();
cy.get('.menu-label').first().click(); cy.get('.menu-label localize[key="create_newEmptyPartialView"]').click();
// The test would fail intermittently, most likely because the editor didn't have time to load // The test would fail intermittently, most likely because the editor didn't have time to load
// This should ensure that the editor is loaded and the test should no longer fail unexpectedly. // This should ensure that the editor is loaded and the test should no longer fail unexpectedly.

View File

@@ -23,7 +23,7 @@ context('Scripts', () => {
cy.umbracoTreeItem("settings", ["Scripts"]).rightclick(); cy.umbracoTreeItem("settings", ["Scripts"]).rightclick();
cy.umbracoContextMenuAction("action-create").click(); cy.umbracoContextMenuAction("action-create").click();
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click(); cy.get('.menu-label localize[key="create_newJavascriptFile"]').click();
//We have to wait here till everything is loaded, or worker will throw error //We have to wait here till everything is loaded, or worker will throw error
cy.intercept('/umbraco/lib/ace-builds/src-min-noconflict/worker-javascript.js').as('aceWorker'); cy.intercept('/umbraco/lib/ace-builds/src-min-noconflict/worker-javascript.js').as('aceWorker');
cy.wait('@aceWorker'); cy.wait('@aceWorker');