mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	adjust test to new spotlight
This commit is contained in:
		@@ -22,17 +22,14 @@ test('PUI - Quick Command', async ({ page }) => {
 | 
				
			|||||||
  await page.locator('body').press(`${systemKey}+k`);
 | 
					  await page.locator('body').press(`${systemKey}+k`);
 | 
				
			||||||
  await page.waitForTimeout(200);
 | 
					  await page.waitForTimeout(200);
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('button', { name: 'Dashboard Go to the InvenTree dashboard' })
 | 
					    .getByRole('button', { name: 'Go to the InvenTree dashboard' })
 | 
				
			||||||
    .click();
 | 
					 | 
				
			||||||
  await page
 | 
					 | 
				
			||||||
    .locator('div')
 | 
					 | 
				
			||||||
    .filter({ hasText: /^Dashboard$/ })
 | 
					 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
 | 
					  await page.locator('p').filter({ hasText: 'Dashboard' }).waitFor();
 | 
				
			||||||
  await page.waitForURL('**/platform/dashboard');
 | 
					  await page.waitForURL('**/platform/dashboard');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Open Spotlight with Button
 | 
					  // Open Spotlight with Button
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page.getByRole('button', { name: 'Home Go to the home page' }).click();
 | 
					  await page.getByRole('button', { name: 'Go to the home page' }).click();
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('heading', { name: 'Welcome to your Dashboard,' })
 | 
					    .getByRole('heading', { name: 'Welcome to your Dashboard,' })
 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
@@ -63,7 +60,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Open Spotlight with Button
 | 
					  // Open Spotlight with Button
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page.getByRole('button', { name: 'Home Go to the home page' }).click();
 | 
					  await page.getByRole('button', { name: 'Go to the home page' }).click();
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('heading', { name: 'Welcome to your Dashboard,' })
 | 
					    .getByRole('heading', { name: 'Welcome to your Dashboard,' })
 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
@@ -71,9 +68,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Use navigation menu
 | 
					  // Use navigation menu
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page
 | 
					  await page.getByRole('button', { name: 'Open the main' }).click();
 | 
				
			||||||
    .getByRole('button', { name: 'Open Navigation Open the main' })
 | 
					 | 
				
			||||||
    .click();
 | 
					 | 
				
			||||||
  // assert the nav headers are visible
 | 
					  // assert the nav headers are visible
 | 
				
			||||||
  await page.getByRole('heading', { name: 'Navigation' }).waitFor();
 | 
					  await page.getByRole('heading', { name: 'Navigation' }).waitFor();
 | 
				
			||||||
  await page.getByRole('heading', { name: 'Pages' }).waitFor();
 | 
					  await page.getByRole('heading', { name: 'Pages' }).waitFor();
 | 
				
			||||||
@@ -86,7 +81,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('button', {
 | 
					    .getByRole('button', {
 | 
				
			||||||
      name: 'Server Information About this Inventree instance'
 | 
					      name: 'About this Inventree instance'
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
  await page.getByRole('cell', { name: 'Instance Name' }).waitFor();
 | 
					  await page.getByRole('cell', { name: 'Instance Name' }).waitFor();
 | 
				
			||||||
@@ -98,7 +93,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('button', {
 | 
					    .getByRole('button', {
 | 
				
			||||||
      name: 'License Information Licenses for dependencies of the service'
 | 
					      name: 'Licenses for dependencies of the service'
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
  await page.getByText('License Information').first().waitFor();
 | 
					  await page.getByText('License Information').first().waitFor();
 | 
				
			||||||
@@ -108,9 +103,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // use about
 | 
					  // use about
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page
 | 
					  await page.getByRole('button', { name: 'About the InvenTree org' }).click();
 | 
				
			||||||
    .getByRole('button', { name: 'About InvenTree About the InvenTree org' })
 | 
					 | 
				
			||||||
    .click();
 | 
					 | 
				
			||||||
  await page.getByText('This information is only').waitFor();
 | 
					  await page.getByText('This information is only').waitFor();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  await page.getByLabel('About InvenTree').getByRole('button').click();
 | 
					  await page.getByLabel('About InvenTree').getByRole('button').click();
 | 
				
			||||||
@@ -119,19 +112,17 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
  await page
 | 
					  await page
 | 
				
			||||||
    .getByRole('button', {
 | 
					    .getByRole('button', {
 | 
				
			||||||
      name: 'Documentation Visit the documentation to learn more about InvenTree'
 | 
					      name: 'Visit the documentation to learn more about InvenTree'
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
  await page.waitForURL('https://docs.inventree.org/**');
 | 
					  await page.waitForURL('https://docs.inventree.org/**');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Test addition of new actions
 | 
					  // Test addition of new actions
 | 
				
			||||||
  await page.goto('./platform/playground');
 | 
					  await page.goto('./platform/playground');
 | 
				
			||||||
  await page
 | 
					  await page.locator('p').filter({ hasText: 'Playground' }).waitFor();
 | 
				
			||||||
    .locator('div')
 | 
					 | 
				
			||||||
    .filter({ hasText: /^Playground$/ })
 | 
					 | 
				
			||||||
    .waitFor();
 | 
					 | 
				
			||||||
  await page.getByRole('button', { name: 'Spotlight actions' }).click();
 | 
					  await page.getByRole('button', { name: 'Spotlight actions' }).click();
 | 
				
			||||||
  await page.getByRole('button', { name: 'Register extra actions' }).click();
 | 
					  await page.getByRole('button', { name: 'Register extra actions' }).click();
 | 
				
			||||||
 | 
					  /*
 | 
				
			||||||
  await page.getByPlaceholder('Search...').fill('secret');
 | 
					  await page.getByPlaceholder('Search...').fill('secret');
 | 
				
			||||||
  await page.getByRole('button', { name: 'Secret action It was' }).click();
 | 
					  await page.getByRole('button', { name: 'Secret action It was' }).click();
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
@@ -143,6 +134,7 @@ test('PUI - Quick Command - no keys', async ({ page }) => {
 | 
				
			|||||||
    .click();
 | 
					    .click();
 | 
				
			||||||
  await page.getByRole('tab', { name: 'Home' }).click();
 | 
					  await page.getByRole('tab', { name: 'Home' }).click();
 | 
				
			||||||
  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
					  await page.getByRole('button', { name: 'Open spotlight' }).click();
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
  await page.getByPlaceholder('Search...').fill('secret');
 | 
					  await page.getByPlaceholder('Search...').fill('secret');
 | 
				
			||||||
  await page.getByText('Nothing found...').click();
 | 
					  await page.getByText('Nothing found...').click();
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user