Skip to content

Increases max viewport from 3000 to 4000 px #2099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8310302
Develop (#1923)
jennifer-shehane Jul 30, 2019
b340c89
Develop (#1928)
jennifer-shehane Aug 2, 2019
0f3569d
Develop (#1953)
jennifer-shehane Aug 5, 2019
5878c2d
Develop (#1964)
jennifer-shehane Aug 6, 2019
fe3c3ca
Develop (#1983)
bahmutov Aug 8, 2019
926eed4
Develop (#1992)
jennifer-shehane Aug 13, 2019
7093cb5
Develop (#2011)
jennifer-shehane Aug 15, 2019
be8f9a1
Merge pull request #2026 from cypress-io/develop
amirrustam Aug 21, 2019
9e160ad
Merge pull request #2037 from cypress-io/develop
amirrustam Aug 23, 2019
651d69d
Fix typo in the cross-origin error section (#2033)
mariusbutuc Aug 23, 2019
331e397
chore(deps): Update dependency @types/jest to version 24.0.18 🌟 (#2029)
renovate[bot] Aug 26, 2019
0b1ce89
add section explaining how to patch Cypress CLI module (#2045)
bahmutov Aug 27, 2019
b8023e9
Develop (#2046)
jennifer-shehane Aug 27, 2019
05c61a3
update error message about stale runs to be more clear
jennifer-shehane Aug 30, 2019
babaa43
Add instructions on how to uninstall Cypress GitHub app
jennifer-shehane Sep 5, 2019
e910dbf
Merge branch 'master' into develop
jennifer-shehane Sep 5, 2019
5cad54b
Add links (#2058)
bahmutov Sep 5, 2019
b3dca03
docs - add missing param (#2061)
qaiken Sep 9, 2019
2938821
Issue-2038 (#2048)
TonySynenko Sep 9, 2019
c004684
add jsconfig section (#2054)
bahmutov Sep 9, 2019
3e8fa6c
Update writing-your-first-test.md (#2043)
kukiiu Sep 9, 2019
9f2ff9b
chore(deps): Update dependency git-last to version 1.2.12 🌟 (#2000)
renovate[bot] Sep 9, 2019
99f5473
chore(deps): Update dependency sinon to version 7.4.2 🌟 (#2052)
renovate[bot] Sep 9, 2019
0a9f01a
try using v2.1 of Circle
bahmutov Sep 11, 2019
12a6a27
testing trigger by commit
bahmutov Sep 11, 2019
548c15b
trigger workflow using empty GitHub commit, close #2069 (#2070)
bahmutov Sep 11, 2019
31e7767
Add support to pt-br (#2065)
Sep 12, 2019
bc3070d
add test automation u course (#2075)
bahmutov Sep 13, 2019
6936c2f
Add cypress-rails mention (#2079)
searls Sep 17, 2019
74f501c
issue 2071 (#2072)
TonySynenko Sep 17, 2019
a65e2d5
chore(deps): Update dependency start-server-and-test to version… (#2078)
renovate[bot] Sep 17, 2019
3345d77
Update for new nav (#2076)
mapsandapps Sep 17, 2019
8447003
Answer how to champion cypress (#2056)
bahmutov Sep 17, 2019
0deb76a
add cypress-fiddle link and blurb (#2060)
bahmutov Sep 17, 2019
07d1169
wrong podcast link, close #2074 (#2080)
prinkov Sep 17, 2019
d3a0a6b
fix(deps): Update dependency hexo-server to version 1.0.0 🌟 (#2053)
renovate[bot] Sep 18, 2019
d560f91
change open to run (#2083)
Sep 18, 2019
a8d4408
Remove url that was breaking the groups section shell code
jennifer-shehane Sep 18, 2019
95ea1a5
Remove url that was breaking the groups section shell code (#2085)
jennifer-shehane Sep 18, 2019
f2b421a
fix(deps): Update dependency contentful to version 7.10.0 🌟 (#2087)
renovate[bot] Sep 19, 2019
2b14e7a
add vscode extension (#2088)
Sep 19, 2019
a41de2d
describe solution to xvfb problem (#2090)
bahmutov Sep 20, 2019
47583ac
add links to native code coverage example and backend cove… (#1788)
bahmutov Sep 20, 2019
2f7063d
increases max viewport from 3000 to 4000 px
nico-bellante Sep 24, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ source/_data/banners.yml
#
source/ja
source/zh-cn
source/pt-br

1 change: 1 addition & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"Sinon–Chai",
"TypeScript",
"YouTube",
["VSCode", "VS Code"],
["^Vue", "Vue.JS"],
"webpack",
["WebSocket(s?)", "WebSocket$1"],
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,15 @@ After making a [pull request](#pull-requests), the CLA assistant will add a revi
## Deployment

We will try to review and merge pull requests as fast as possible. After merging, we will deploy it to the staging environment, run E2E tests (using Cypress itself of course!), and then merge it into `master`, which will deploy it to the official [https://docs.cypress.io](https://docs.cypress.io) website. If you want to know our deploy process, read [DEPLOY.md](DEPLOY.md).

### Trigger workflow build

Due to CircleCI API limitations (even after 2 years), you cannot trigger a workflow build using the API. Thus if you need to build, test and deploy `develop` branch for example, your best bet is to create an empty GitHub commit in the [cypress-io/cypress-documentation](https://github.com/cypress-io/cypress-documentation) repository in the `develop` branch. We have added [make-empty-github-commit](https://github.com/bahmutov/make-empty-github-commit) as a dev dependency and set it as `make-empty-commit` NPM script in the [package.json](package.json).

To trigger production rebuild and redeploy, use personal GitHub token and run:

```shell
GITHUB_TOKEN=<your token> npm run make-empty-commit -- --message "trigger deploy" --branch master
```

As always, using [as-a](https://github.com/bahmutov/as-a) is recommended for storing and using sensitive environment variables.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ language:
- en
- zh-cn
- ja
- pt-br

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
Expand Down
7 changes: 4 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 2
# let's try using orbs, jobs, commands
version: 2.1

env_defaults: &env_defaults
## this enables colors + fixes failing unit tests
Expand Down Expand Up @@ -159,8 +160,8 @@ workflows:
- docs-tests:
requires:
- build
# we can deploy development docs in parallel with
# unit testining them.
# we can deploy development docs in parallel
# with unit testing them.
- deploy-docs-staging:
filters:
branches:
Expand Down
10 changes: 7 additions & 3 deletions copy-english-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const getLanguageName = (short) => {
const names = {
ja: 'Japanese',
'zh-cn': 'Chinese',
'pt-br': 'Portuguese Brazil',
}

if (!names[short]) {
Expand Down Expand Up @@ -48,8 +49,9 @@ const findAllDocs = () => {

const isJapaneseDoc = R.test(/\/ja\//)
const isChineseDoc = R.test(/\/zh-cn\//)
const isPortugueseDoc = R.test(/\/pt-br\//)
const isImage = R.test(/\/img\//)
const isTranslation = R.anyPass([isJapaneseDoc, isChineseDoc, isImage])
const isTranslation = R.anyPass([isJapaneseDoc, isChineseDoc, isPortugueseDoc, isImage])

const translationsFilter = R.reject(isTranslation)

Expand All @@ -60,7 +62,7 @@ const findAllEnglishDocs = () => {
}

/**
* @param {("ja" | "zh-cn")} shortName The short language name
* @param {("ja" | "zh-cn" | "pt-br")} shortName The short language name
*/
const findAllDocsFor = (shortName) => {
const relativeSourceFolder = `source/${shortName}`
Expand All @@ -69,7 +71,7 @@ const findAllDocsFor = (shortName) => {
}

/**
* @param {("ja" | "zh-cn")} targetLanguage
* @param {("ja" | "zh-cn" | "pt-br")} targetLanguage
*/
const copyAllEnglishDocsNotTranslatedTo = (targetLanguage) => {
return Promise.all([
Expand Down Expand Up @@ -107,6 +109,8 @@ const copyUntranslatedDocs = () => {
return copyAllEnglishDocsNotTranslatedTo('ja')
.then(() => {
return copyAllEnglishDocsNotTranslatedTo('zh-cn')
}).then(() => {
return copyAllEnglishDocsNotTranslatedTo('pt-br')
})

}
Expand Down
149 changes: 140 additions & 9 deletions cypress/integration/contentful_banners_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function removeNonAscii (string) {
.replace(/ +/gim, ' ')
}

describe('stripEmoji is working', () => {
describe('removeNonAscii is working', () => {
const allEmoji = `
😀 😁 😂 🤣 😃 😄 😅 😆 😉 😊 😋 😎 😍 😘 🥰 😗 😙 😚 ☺️ 🙂 🤗 🤩 🤔 🤨 😐 😑 😶 🙄 😏 😣 😥 😮 🤐 😯 😪 😫 😴 😌 😛 😜 😝 🤤 😒 😓 😔 😕 🙃 🤑 😲 ☹️ 🙁 😖 😞 😟 😤 😢 😭 😦 😧 😨 😩 🤯 😬 😰 😱 🥵 🥶 😳 🤪 😵 😡 😠 🤬 😷 🤒 🤕 🤢 🤮 🤧 😇 🤠 🤡 🥳 🥴 🥺 🤥 🤫 🤭 🧐 🤓 😈 👿 👹 👺 💀 👻 👽 🤖 💩 😺 😸 😹 😻 😼 😽 🙀 😿 😾
People and Fantasy
Expand Down Expand Up @@ -100,17 +100,19 @@ describe('stripEmoji is working', () => {
})

describe('Contentful driven banners', () => {
it('displays all current banners with proper info', function () {
before(() => cy.visit('/'))

it('Should display all current banners with proper info', function () {
cy.task('readFileMaybe', allBannersYaml)
.then((yamlString) => {
if (typeof yamlString === 'undefined' || yamlString === null) return this.skip()

const yamlObject = YAML.parse(yamlString)
const yamlArray = YAML.parse(yamlString) || []

// remove all outdated or future banners
const setMyTimezoneToDate = (date) => new Date(Date.parse(date))

return yamlObject.filter((banner) => {
return yamlArray.filter((banner) => {
const now = new Date()
const startDate = setMyTimezoneToDate(banner.startDate)
const endDate = setMyTimezoneToDate(banner.endDate)
Expand All @@ -119,14 +121,14 @@ describe('Contentful driven banners', () => {
})
})
.then((banners) => {
if (typeof banners === 'undefined' || !banners || !banners.length) return this.skip()

cy.visit('/')
if (typeof banners === 'undefined' || !banners || !banners.length) {
return this.skip()
}

cy.get('#header .top-banners_item')
cy.get('#header').find('.top-banners-item')
.each((banner, i) => {
cy.wrap(banner)
.find('.top-banners_item--body')
.find('.top-banners-item__body__text')
.invoke('text').invoke('trim')
.should((bannerText) => {
const htmlText = removeNonAscii(regexpTrim(bannerText))
Expand Down Expand Up @@ -156,4 +158,133 @@ describe('Contentful driven banners', () => {
})
})
})

it('Should close individual banner', function () {
cy.task('readFileMaybe', allBannersYaml)
.then((yamlString) => {
if (typeof yamlString === 'undefined' || yamlString === null) return this.skip()

const yamlArray = YAML.parse(yamlString) || []

// remove all outdated or future banners
const setMyTimezoneToDate = (date) => new Date(Date.parse(date))

return yamlArray.filter((banner) => {
const now = new Date()
const startDate = setMyTimezoneToDate(banner.startDate)
const endDate = setMyTimezoneToDate(banner.endDate)

return startDate <= now && now <= endDate
})
})
.then((banners) => {
if (typeof banners === 'undefined' || !banners || !banners.length) {
return this.skip()
}

const banner = banners[0]
const notUniquerBanner = banners.splice(1).map((b) => b.id)

cy.get(`.top-banners-item[data-id="${banner.id}"]`)
.find('.top-banners-item__btn_close')
.first()
.click()

cy.get(`.top-banners_item[data-id="${banner.id}"]`).should('not.exist').then(() => {
const closedBanners = window.localStorage.getItem('cypress_docs_closed_banners') !== null ?
JSON.parse(window.localStorage.getItem('cypress_docs_closed_banners'))
: []

expect(closedBanners).to.include(banner.id)

if (notUniquerBanner.length) {
expect(closedBanners).not.have.members(notUniquerBanner)
cy.get('#header').find('.top-banners-item:not(.top-banners-item_is-closed)').each(($banner) => {
expect(notUniquerBanner).have.members([$banner.data('id')])
})
}
})
})
})

it('Should close each banner with a close button', function () {
window.localStorage.removeItem('cypress_docs_closed_banners')

cy.visit('/')

cy.get('#header')
.then((header) => {
const bannerItems = header.find('.top-banners-item')

if (!bannerItems.length) {
return this.skip()
}

cy.get(bannerItems).each(($banner) => {
cy.get($banner.find('.top-banners-item__btn_close')).as('closeBtn')

cy.get('@closeBtn').click().then(() => {
const id = $banner.data('id')

cy.get(`.top-banners-item[data-id="${id}"]`).should('not.exist')

const closedBanners = window.localStorage.getItem('cypress_docs_closed_banners') !== null ?
JSON.parse(window.localStorage.getItem('cypress_docs_closed_banners'))
: []

expect(closedBanners).to.include(id)
})
})
})
})

it('Displays Algolia dropdown on focus after close all banners', function () {
cy.server()

cy.route({
method: 'POST',
url: /algolia/,
response: {
'results': [
{
'hits': [
{
'hierarchy': { 'lvl2': null, 'lvl3': null, 'lvl0': 'Known Issues', 'lvl1': null, 'lvl6': null, 'lvl4': null, 'lvl5': null },
'url': 'https://docs-staging.cypress.io/guides/appendices/known-issues.html#content-inner', 'content': 'cy.get', 'anchor': 'content-inner', 'objectID': '15872310', '_snippetResult': { 'content': { 'value': 'to implement in Cypress. Right <span class="algolia-docsearch-suggestion--highlight">click Issue #53</span> Workaround Oftentimes', 'matchLevel': 'full' } }, '_highlightResult': { 'hierarchy': { 'lvl0': { 'value': 'Known Issues', 'matchLevel': 'none', 'matchedWords': [] } }, 'content': { 'value': 'cy.get', 'matchLevel': 'full', 'fullyHighlighted': false, 'matchedWords': ['click', 'issue', '53'] }, 'hierarchy_camel': [{ 'lvl0': { 'value': 'Known Issues', 'matchLevel': 'none', 'matchedWords': [] } }] },
},
], 'nbHits': 1, 'page': 0, 'nbPages': 1, 'hitsPerPage': 5, 'processingTimeMS': 1, 'exhaustiveNbHits': true, 'query': '"click Issue #53" ', 'params': 'query=%22click%20Issue%20%2353%22%20&hitsPerPage=5', 'index': 'cypress',
},
],
},
}).as('postAlgolia')

cy.get('.ds-dropdown-menu').should('not.be.visible')
cy.get('#search-input').type('g')
cy.wait('@postAlgolia')
cy.get('.ds-dropdown-menu').should('be.visible')
})

it('Collapse sidebar links', function () {
cy.window().then((win) => {
if (win.innerWidth < 768) {
return this.skip()
}

cy.get('#collapse-sidebar').click()
cy.get('.sidebar-title').each(($sidebar) => cy.get($sidebar).should('have.class', 'is-collapsed'))
})
})

it('Expand sidebar links', function () {
cy.window().then((win) => {
if (win.innerWidth < 768) {
return this.skip()
}

cy.get('#expand-sidebar').click()
cy.get('.sidebar-title').each(($sidebar) => cy.get($sidebar).should('not.have.class', 'is-collapsed'))
})
})

after(() => window.localStorage.removeItem('cypress_docs_closed_banners'))
})
1 change: 1 addition & 0 deletions cypress/integration/main_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('Main', () => {
cy.request('/robots.txt').its('body')
.should('include', 'Disallow: /ja/')
.and('include', 'Disallow: /zh-cn/')
.and('include', 'Disallow: /pt-br/')
})
}
})
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/mobile_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ context('Mobile', () => {
})
})
})

require('./contentful_banners_spec')
})
})
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,20 @@ function initHexo () {
return new Promise((resolve, reject) => {
const space = hexo.env.GATSBY_CONTENTFUL_SPACE_ID || process.env.GATSBY_CONTENTFUL_SPACE_ID
const accessToken = hexo.env.GATSBY_CONTENTFUL_ACCESS_TOKEN || process.env.GATSBY_CONTENTFUL_ACCESS_TOKEN
const environment = env !== 'production' ? 'staging' : 'master'

if (typeof space === 'undefined' || typeof accessToken === 'undefined') {
return reject({
message: 'No Contentful space variables.',
})
}

return Contentful.createClient({ space, accessToken })
return Contentful.createClient({ space, accessToken, environment })
.getEntries({ content_type: 'topBanner' })
.then(({ items }) => {
const data = items.reduce((filtered, option) => {
if (moment(option.fields.endDate).isSameOrAfter(moment())) {
filtered.push({ ...option.fields, text: documentToHtmlString(option.fields.text) })
const data = items.reduce((filtered, { sys: { id }, fields }) => {
if (moment(fields.endDate).isSameOrAfter(moment())) {
filtered.push({ id, ...fields, text: documentToHtmlString(fields.text) })
}

return filtered
Expand Down
Loading