Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,11 @@ export default tseslint.config(
'perfectionist/sort-named-imports': 'off',
'perfectionist/sort-union-types': 'off',
},
},
{
files: ['run/test/specs/locators/*'],
rules: {
'perfectionist/sort-modules': 'error',
},
}
);
35 changes: 16 additions & 19 deletions run/test/specs/locators/browsers.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { LocatorsInterface } from '.';

// SHARED LOCATORS
export class URLInputField extends LocatorsInterface {
export class ChromeNotificationsNegativeButton extends LocatorsInterface {
public build() {
switch (this.platform) {
case 'android':
return {
strategy: 'id',
selector: 'com.android.chrome:id/url_bar',
selector: 'com.android.chrome:id/negative_button',
} as const;
case 'ios':
return {
strategy: 'accessibility id',
selector: 'URL',
} as const;
throw new Error('Unsupported platform');
}
}
}

// ANDROID ONLY
export class ChromeUseWithoutAnAccount extends LocatorsInterface {
public build() {
switch (this.platform) {
Expand All @@ -34,43 +29,45 @@ export class ChromeUseWithoutAnAccount extends LocatorsInterface {
}
}

export class ChromeNotificationsNegativeButton extends LocatorsInterface {
export class SafariAddressBar extends LocatorsInterface {
public build() {
switch (this.platform) {
case 'android':
throw new Error('Unsupported platform');
case 'ios':
return {
strategy: 'id',
selector: 'com.android.chrome:id/negative_button',
strategy: 'accessibility id',
selector: 'TabBarItemTitle',
} as const;
case 'ios':
throw new Error('Unsupported platform');
}
}
}

// iOS ONLY
export class SafariAddressBar extends LocatorsInterface {
export class SafariShareButton extends LocatorsInterface {
public build() {
switch (this.platform) {
case 'android':
throw new Error('Unsupported platform');
case 'ios':
return {
strategy: 'accessibility id',
selector: 'TabBarItemTitle',
selector: 'ShareButton',
} as const;
}
}
}
export class SafariShareButton extends LocatorsInterface {
export class URLInputField extends LocatorsInterface {
public build() {
switch (this.platform) {
case 'android':
throw new Error('Unsupported platform');
return {
strategy: 'id',
selector: 'com.android.chrome:id/url_bar',
} as const;
case 'ios':
return {
strategy: 'accessibility id',
selector: 'ShareButton',
selector: 'URL',
} as const;
}
}
Expand Down
Loading