Skip to content

Commit

Permalink
Merge pull request #735 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v2.8.0
  • Loading branch information
robertu7 authored Feb 28, 2020
2 parents f8ae612 + 38e17fa commit 696c8e4
Show file tree
Hide file tree
Showing 568 changed files with 13,091 additions and 11,991 deletions.
2 changes: 2 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[
"next/babel",
{
"preset-env": { "modules": false },
"transform-runtime": { "useESModules": false },
"styled-jsx": {
"plugins": ["styled-jsx-plugin-postcss"]
}
Expand Down
37 changes: 33 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,45 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.8.0] - 2020-02-28

### Revamp

- Revamp: `<Dialog>` & `<DropdownDialog>` #689 #712
- Revamp: Forms #716 #736 #744 #747 #748
- Revamp: Appreciations #703
- Refactor: `<Menu>`, `<SearchBar>` #662
- Refactor: `<Translate>` & `translate` support using `id` #719

### Changed

- Create infinite list using `react-virtualized` #697 #701 #706
- Enhance Responsive #742
- Tree shaking and article detail query refactor #678
- Dynamic Imports: `<Dialog>` and `firebase` #700
- Revamp FollowButton for sizing. #727
- Add extra footer #734
- Add react hook for window resize. #690
- Add back collapsed comments #710
- Add back missing refresh button of sidebar authors #704
- Skip polling if the user hasn't logged in #688

## [2.7.0] - 2020-02-06

### Added

- Recommendation test page #625
- Add selected feed under tag page #650 #654 #659

### Changed
### Revamp

- Refactor: `<Comment>`, `<UserDigest>`, `<ArticleDigest>` #609 #658 #661
- Refactor: `<Button>` #651
- Refactor: `Toast` #667
- Refactor: New Icons #647

### Changed

- Change tag detail API names and params. #617
- Restructure of tag detail page #616
- Remove close button of Toast #663
Expand All @@ -29,14 +55,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2.6.0] - 2020-01-13

### Revamp

- Refactor: Alter CSS variables for Matters 3.0
- Refactor: Using SVGR #576
- Refactor: i18n #584

### Changed

- Add more test cases for home page. #557 #575
- Feed dedupe #574
- Allow onboarding user to appreciate articles #592
- Refactor: Alter CSS variables for Matters 3.0
- Refactor: Using SVGR #576
- Refactor: i18n #584
- Bump deps #559 #558 #567 #568 #569 #582 #580 #578 #587 #581

## [2.5.1] - 2019-12-31
Expand Down
50 changes: 50 additions & 0 deletions bdd/features/side_bar.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Feature: Side Bar
Test functionalities of side bar components.

Scenario: Load Matters Today
Given I visit home page
Then the Side Bar is visible


Scenario: Don't Miss Section Test
Given the Cannot Miss section is visible
When I click the fisrt article
Then the first article page should be visible
Then go back to previous page
Given the Cannot Miss section is visible
When I click the first author
Then the author page should be visible

Scenario: Hashtag Section Test
Then go back to previous page
When I scroll down to the hashtag section
Given the hashtag section is visible
When I click the first hashtag
Then the first hashtag page should be visible
Then go back to previous page
Given the hashtag section is visible
When I click check all hashtag button
Then the all hashtag page should be visible

Scenario: Hot Topics Test
Then go back to previous page
When I scroll down to the hot topics section
Given the hot topics section is visible
When I click the first hot topic
Then the first topic page should be visible
Then go back to previous page
Given the hot topics section is visible
When I click the all hot topics button
Then the all hot topics page should be visible

Scenario: Active Authors Test
Then go back to previous page
When I scroll down to the active authors section
Given the active authors section is visible
When I click the first active author
Then the author page should be visible
Then go back to previous page
Given the hot topics section is visible
Given the sign-in button is visible
When I click the follow button
Then the require sign-in notification should be visible
31 changes: 29 additions & 2 deletions bdd/steps/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,37 @@ Then('the Article page should be visible', () => {
return waitPageToBeVisible(client, 'h1.article')
})

Then('the User page should be visible', () => {
Then('go back to home page', () => {
return client.url('http://matters.news').waitForElementVisible('body', 1000)
})

Then('go back to previous page', () => {
return client.back().waitForElementVisible('body', 1000)
})

Then('the first article page should be visible', () => {
return waitPageToBeVisible(client, 'h1.article')
})

Then('the author page should be visible', () => {
return waitPageToBeVisible(client, 'main > section > div:nth-child(2)')
})

Then('the Tag page should be visible', () => {
Then('the first hashtag page should be visible', () => {
return waitPageToBeVisible(client, 'main > article > header > section.title')
})

Then('the all hashtag page should be visible', () => {
return waitPageToBeVisible(client, 'main > article > header > section.title')
})

Then('the all hot topics page should be visible', () => {
return waitPageToBeVisible(client, 'main > article > header > section.title')
})

Then('the first topic page should be visible', () => {
return waitPageToBeVisible(
client,
'main > article > section.jsx-2196064359.title > h1'
)
})
118 changes: 118 additions & 0 deletions bdd/steps/side_bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
const { client } = require('nightwatch-api')
const { Given, Then, When } = require('cucumber')

const PATH = require('../common/enums/path')
const SCRIPT = require('../common/enums/script')
const TIME = require('../common/enums/time')

Then('the Side Bar is visible', () => {
const query = 'main > aside'
return client.maximizeWindow().assert.visible(`${query}`)
})

/*----- Cannot Miss -----*/

Given('the Cannot Miss section is visible', () => {
const query = 'main > aside'
return client.assert.visible(`${query} > section:nth-child(1)`)
})

When('I click the fisrt article', () => {
const query =
'main > aside > section:nth-child(1) > section > section:nth-child(1) > section > section '
return client.click(`${query} > header > a`).pause(2 * TIME.SECOND)
})

When('I click the first author', () => {
const query =
'main > aside > section:nth-child(1) > section > section:nth-child(1) > section > section '
return client.click(`${query} > footer > a`).pause(2 * TIME.SECOND)
})

/*----- Hashtag list -----*/
When('I scroll down to the hashtag section', () => {
const query = '#__next > main > aside > section.jsx-1380876058'
return client.execute(
`document.querySelector('${query}').scrollIntoView({ block: 'center' })`
)
})

Given('the hashtag section is visible', () => {
const query = 'main > aside'
return client.assert.visible(`${query} > section.jsx-1380876058`)
})

When('I click the first hashtag', () => {
const query = '#__next > main > aside > section.jsx-1380876058 > ul'
return client.click(`${query} > li:nth-child(1) > a`).pause(2 * TIME.SECOND)
})

When('I click check all hashtag button', () => {
const query = '#__next > main > aside > section.jsx-1380876058'
return client.click(`${query} > header > a`).pause(2 * TIME.SECOND)
})

/*----- Hot topics -----*/
When('I scroll down to the hot topics section', () => {
const query = '#__next > main > aside > section.jsx-1380876058'
return client.execute(
`document.querySelector('${query}').scrollIntoView({ block: 'center' })`
)
})

Given('the hot topics section is visible', () => {
const query = 'main > aside'
return client.assert.visible(`${query} > section:nth-child(3)`)
})

When('I click the first hot topic', () => {
const query = '#__next > main > aside > section:nth-child(3) > ol'
return client
.click(`${query} > li:nth-child(1) > section > section > a`)
.pause(2 * TIME.SECOND)
})

When('I click the all hot topics button', () => {
const query = '#__next > main > aside > section:nth-child(3)'
return client.click(`${query} > header > a`).pause(2 * TIME.SECOND)
})

/*----- Active authors -----*/
When('I scroll down to the active authors section', () => {
const query = '#__next > main > aside > section:nth-child(4)'
return client.execute(
`document.querySelector('${query}').scrollIntoView({ block: 'center' })`
)
})

Given('the active authors section is visible', () => {
const query = 'main > aside'
return client.assert.visible(`${query} > section:nth-child(4)`)
})

When('I click the first active author', () => {
const query = '#__next > main > aside > section:nth-child(4) > section'
return client
.click(`${query} > section:nth-child(1) > section > section`)
.pause(2 * TIME.SECOND)
})

When('I click the follow button', () => {
const query =
'#__next > main > aside > section:nth-child(4) > section > section:nth-child(1)'
return client
.click(
`${query} > section > section > section.jsx-2972492538.extra-button > button`
)
.pause(3 * TIME.SECOND)
})

Given('the sign-in button is visible', () => {
return client.assert.visible(
`header > div > div > section.jsx-3112733317.right > button.jsx-1553655394`
)
})

Then('the require sign-in notification should be visible', () => {
return client.assert.visible(`section > div > div > section`)
})
Loading

0 comments on commit 696c8e4

Please sign in to comment.