forked from owncloud/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get rid of isVisible() (owncloud#8726)
part2 fix
- Loading branch information
1 parent
d46b992
commit d4a384c
Showing
9 changed files
with
36 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
import { expect } from '@playwright/test' | ||
import { Page } from 'playwright' | ||
import util from 'util' | ||
|
||
const emptySpacesSelector = '//span[@data-msgid="%s"]' | ||
const spaceIdSelector = `[data-item-id="%s"]` | ||
|
||
export interface searchForSpacesIdsArgs { | ||
spaceID: string | ||
page: Page | ||
} | ||
export const spaceWithSpaceIDExist = async (args: searchForSpacesIdsArgs): Promise<boolean> => { | ||
export const spaceWithSpaceIDNotExist = async (args: searchForSpacesIdsArgs): Promise<void> => { | ||
const { page, spaceID } = args | ||
const emptySpacesMessage = "You don't have access to any spaces" | ||
|
||
// for empty case | ||
if (await page.isVisible(util.format(emptySpacesSelector, emptySpacesMessage))) { | ||
return true | ||
} | ||
// if more than one spaces exists | ||
if (!(await page.isVisible(util.format(spaceIdSelector, spaceID)))) { | ||
return true | ||
} | ||
return false | ||
const space = page.locator(util.format(spaceIdSelector, spaceID)) | ||
await expect(space).not.toBeVisible() | ||
} |