fix: scroll down pagination
This commit is contained in:
@@ -315,7 +315,7 @@ export class SelectorValidator {
|
|||||||
const win = window as any;
|
const win = window as any;
|
||||||
|
|
||||||
if (typeof win.autoDetectPagination === 'function') {
|
if (typeof win.autoDetectPagination === 'function') {
|
||||||
const result = win.autoDetectPagination(selector, { disableScrollDetection: true });
|
const result = win.autoDetectPagination(selector, { disableScrollDetection: false });
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
console.error('autoDetectPagination function not found!');
|
console.error('autoDetectPagination function not found!');
|
||||||
@@ -345,7 +345,16 @@ export class SelectorValidator {
|
|||||||
const loadMoreVerified = await this.testLoadMoreButton(buttonResult.selector, listSelector);
|
const loadMoreVerified = await this.testLoadMoreButton(buttonResult.selector, listSelector);
|
||||||
|
|
||||||
if (!loadMoreVerified) {
|
if (!loadMoreVerified) {
|
||||||
logger.warn('Load More button did not load content, trying other detection methods');
|
logger.warn('Load More button did not load content, falling back to scroll detection');
|
||||||
|
const scrollTestResult = await this.testInfiniteScrollByScrolling(listSelector);
|
||||||
|
|
||||||
|
if (scrollTestResult.detected) {
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
type: 'scrollDown',
|
||||||
|
selector: null
|
||||||
|
};
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(`Verified Load More button works`);
|
logger.info(`Verified Load More button works`);
|
||||||
return {
|
return {
|
||||||
@@ -364,16 +373,6 @@ export class SelectorValidator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollTestResult = await this.testInfiniteScrollByScrolling(listSelector);
|
|
||||||
|
|
||||||
if (scrollTestResult.detected) {
|
|
||||||
return {
|
|
||||||
success: true,
|
|
||||||
type: 'scrollDown',
|
|
||||||
selector: null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
type: '',
|
type: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user