Background
If we introduce a pre-generated summary feature as an opt-in feature on a the mobile site of a production wiki, we will be able to measure a CTR greater than 4%, ensure no negative effects to session length, pageviews, or internal referrals, and use this data to decide how and if we will further scale the summary feature."
To get started on this we need to have an entry point and an incremental code base to work on.
User story
As a user I see a banner at the top of mobile page views
Requirements
- All code lives in the new ArticleSummaries extension created in T386476.
- The banner does not show to browsers where JavaScript is not supported (either disabled or an old browser e.g. IE11)
[]x The banner makes use of the ArticleSummariesEnabled feature flag and is only shown when that flag is enabled.
- The banner only shows on the Minerva skin.
- A banner is shown at the top of pages which have a simple summary available. For now given we do not have simple summaries, this will be provided by a function hasSimpleSummaries( Title $title ) which returns a boolean.
- The banner should only display on articles which do not contain a hatnote or ambox. To keep things simple here, this should be detected by checking the article HTML for the presence of the word "hatnote" or "ambox". When a banner is excluded on a page, we log a message using the follwoing code:
$logger = LoggerFactory::getInstance( 'ArticleSummaries' ); $logger->warning( 'ArticleSummaries not supported on this page.' );
- The banner for now should use the current date for the message "Machine generated on". This will be wired up later.
- The banner can be localized.
BDD
Feature: Display simple summary banner under specific conditions
Scenario: Banner displays for eligible articles
Given I am using a JavaScript-enabled browser
And the ArticleSummariesEnabled feature flag is enabled
And I am viewing a page using the Minerva skin
And the function hasSimpleSummaries( Title $title ) returns true
And the article does not contain "hatnote" or "ambox" in its HTML
When I view the page
Then the simple summary banner is displayed at the top
And the banner message includes today’s date with "Machine generated on"
And the banner is localized
Scenario: Banner does not display when JS is disabled
Given I have disabled JavaScript in my browser
When I view any article page
Then the simple summary banner is not displayed
Scenario: Banner does not display on non-Minerva skins
Given I am viewing a page using a non-Minerva skin
When I view the page
Then the simple summary banner is not displayed
Scenario: Banner does not display if hatnote or ambox is present
Given I am using a JavaScript-enabled browser with ArticleSummariesEnabled flag active
And I view an article that contains "hatnote" or "ambox" in the HTML
When I view the page
Then the simple summary banner is not displayed
And a warning log message "ArticleSummaries not supported on this page." is recordedTest Steps
Test Case 1: Verify summary banner displays on eligible article
- Visit https://mylists.wmcloud.org/index.php/Main_Page in mobile view with JavaScript enabled.
- Ensure you are logged out.
- Confirm the Minerva skin is used.
- AC1: Confirm the simple summary banner appears at the top of the page.
- AC2: Confirm the banner text includes today’s date and the phrase “Machine generated on”.
- Append ?uselang=qqx to the URL.
- AC3: Confirm all banner text is no longer in English (i.e., keys are shown for localization).
Test Case 2: Verify banner does not display when hatnote is present
- Visit https://mylists.wmcloud.org/index.php/Hatnote in mobile view with JavaScript enabled.
- Ensure you are logged out and using Minerva skin.
- AC4: Confirm the simple summary banner is not displayed.
- AC5: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”
Test Case 3: Verify banner does not display when ambox is present
- Visit https://mylists.wmcloud.org/index.php/Ambox in mobile view with JavaScript enabled.
- Ensure you are logged out and using Minerva skin.
- AC6: Confirm the simple summary banner is not displayed.
- AC7: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”
Test Case 4: Verify banner does not display when JavaScript is disabled
- Disable JavaScript in the browser settings.
- Visit https://mylists.wmcloud.org/index.php/Main_Page.
- AC8: Confirm the simple summary banner is not displayed.
Test Case 5: Verify banner does not display on non-Minerva skins
- Visit https://mylists.wmcloud.org/index.php/Main_Page?useskin=vector.
- AC9: Confirm the simple summary banner is not displayed.
Design
Acceptance criteria
See requirements.
Communication criteria - does this need an announcement or discussion?
- Add communication criteria
Rollback plan
- What is the rollback plan in production for this task if something goes wrong?
This task was created by Version 1.2.0 of the Web team task template using phabulous







