franzenzenhofer / f19n-obtrusive-livetest

A sandboxed, extendable testing chrome extension and framework! It runs pre-defined and custom tests on each page that you visit.
https://chrome.google.com/webstore/detail/f19n-obstrusive-live-test/jbnaibigcohjfefpfocphcjeliohhold?hl=en
55 stars 1 forks source link

Priority Sorting #82

Closed franzenzenhofer closed 5 years ago

franzenzenhofer commented 5 years ago

when returning a result, it should be possible to submit an option "priority" value (integer)

i.e.: done(that.createResult(lable, msg, type, what, priority)); done(that.createResult(lable, msg, type, what, 10000 ));

priority default is 0

when rules are executed and the output listed in the panel. then the current sorting (errors first, then warning, info) should remain.

each section (errors, warning, info) should be sorted then descending (highes first, lowest last) based on priority.

neuling commented 5 years ago

Done.

createResult now accepts a 5th argument 'priority'.

…
return done(this.createResult('TEST', 'High prio message', 'info', null, 10));
…

Btw you can always return an object instead of createResult. So you don't have to write down all the unnecessary arguments just to add a priority (default: 0):

…
return done({ label: 'Test', message: 'High prio message', priority: 10 });
…

Please pull from the master, apply some priorities to your rules and test it.

franzenzenhofer commented 5 years ago

added priors to these cases

image

seo title - prio 1000 h1 - prio 900 fb - prio 800

only in cases of an "info" response .

but in the case of https://www.veganblatt.com/superfood-pralinen it does not work, no priority sorting applied

image

neuling commented 5 years ago

@franzenzenhofer should be fixed. Pls pull and try again.

franzenzenhofer commented 5 years ago

works as intended!