Skip to content

Commit

Permalink
Merge branch 'develop' into keycloak-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaSachs authored Mar 27, 2020
2 parents 9ee399d + 4d32f7d commit 418c8b6
Show file tree
Hide file tree
Showing 99 changed files with 1,811 additions and 898 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.0
8.16.0
1 change: 1 addition & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
["test runner", "Test Runner"],

// Brands and Technologies
["ansi", "ANSI"],
"AppVeyor",
"Babel",
["^Blob(?! %)", "Blob"],
Expand Down
13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Thanks for taking the time to contribute! :smile:
- [Adding Plugins](#adding-plugins)
- [Adding Pages](#adding-pages)
- [Writing the Changelog](#writing-the-changelog)
- [Translating](#translating)
- [Committing Code](#committing-code)
- [Linting](#linting)
- [Pull Requests](#pull-requests)
Expand Down Expand Up @@ -103,9 +104,19 @@ To add a page such as a new guide or API documentation:
- Link to your new page in the [`sidebar.yml`](/source/_data/sidebar.yml).
- Add translations for the sidebar link for each supported language (for English, this is located in [`en.yml`](/themes/cypress/languages/en.yml)).
- Build the documentation site locally so that you can visually inspect your new page and the links to it.
- Commit the new file using git - we auto-generate the doc to display within each supported language, this auto-generation depends on the file existing in git.
- **REQUIRED**: Commit the new file using git - we auto-generate the doc to display within each supported language, this auto-generation depends on the file existing in git.
- Submit a [pull request](#Pull-Requests) for your change.

### Deleting Pages

To delete a page:

- Delete the page from the relevant directory under [`source`](/source).
- Remove the link from the the [`sidebar.yml`](/source/_data/sidebar.yml).
- Remove the translations for the sidebar link for each supported language (for English, this is located in [`en.yml`](/themes/cypress/languages/en.yml)).
- **REQUIRED**: Commit the change using git - we auto-remove the doc within each supported language, this auto-generation depends on the file being deleted in git, the build will not work until this is commited.
- Build the documentation site locally so that you can visually inspect and make sure it was properly deleted.

#### A Worked Example

Let's imagine that the Cypress team has just added a new command called `privateState` and you've picked up the task to document it.
Expand Down
8 changes: 8 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ jobs:
path: cypress/screenshots
- store_artifacts:
path: npm-debug.log
# store NPM logs in case there was a problem
- store_artifacts:
path: ~/.npm/_logs

"deploy-docs-production":
<<: *defaults
Expand All @@ -150,6 +153,11 @@ jobs:
# use script that just deploys without rebuilding the production docs
- run: npm run deploy-prebuilt -- --environment production --scrape
- run: cat public/build.json
- store_artifacts:
path: npm-debug.log
# store NPM logs in case there was a problem
- store_artifacts:
path: ~/.npm/_logs

workflows:
version: 2
Expand Down
3 changes: 2 additions & 1 deletion cy_scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function deployEnvironmentBranch (env, branch) {
checkBranchEnvFolder(branch)(env)

debug('uploading to S3 dist folder %s', distDir)
uploadToS3(distDir, env)

return uploadToS3(distDir, env)
.then(() => scrapeDocs(env, branch))
.then(() => {
console.log(chalk.yellow('\n==============================\n'))
Expand Down
8 changes: 8 additions & 0 deletions cy_scripts/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ function checkToken (token) {
}

function getCircleCredentials () {
// the JSON file should have an object like
// { "token": "abc123..." }
// where the token is your personal API token from CircleCI
// alternatively, put the JSON object into environment variable
// with file shown by filenameToShellVariable(jsonFile) call
// which is something like _circle_credentials_json
// you can load such environment variable quickly from local terminal with
// https://github.com/bahmutov/as-a
const jsonFile = path.join('support', '.circle-credentials.json')
const config = configFromEnvOrJsonFile(jsonFile)

Expand Down
24 changes: 24 additions & 0 deletions cypress/integration/i18n_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ describe('i18n', () => {
cy.url().should('contain', 'why-cypress')
})

context('alternate links', () => {
it('provides an alternate link for available English languages', function () {
cy.wrap(this.langValues).each((lang) => {
cy.get(`link[hreflang="${lang}"]`).should(($linkTag) => {
let expectedPath = `${lang}/guides/overview/why-cypress.html`

if (lang === 'en') {
expectedPath = 'guides/overview/why-cypress.html'
}

expect($linkTag[0].rel).to.eq('alternate')
expect($linkTag[0].href).to.include(expectedPath)
})
})
})

it('provides a default', function () {
cy.get('link[hreflang="x-default"]').should(($linkTag) => {
expect($linkTag[0].rel).to.eq('alternate')
expect($linkTag[0].href).to.include('guides/overview/why-cypress.html')
})
})
})

context('language select', () => {
it('selects English by default', () => {
cy.get('#lang-select').find('option')
Expand Down
12 changes: 0 additions & 12 deletions cypress/integration/main_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ describe('Main', () => {
cy.server()
})

context('robots.txt', () => {
if (!Cypress.isDevelopment()) {
it('has robots.txt', () => {
cy.request('/robots.txt').its('body')
.should('include', 'Disallow: /ja/')
.and('include', 'Disallow: /zh-cn/')
.and('include', 'Disallow: /pt-br/')
.and('include', 'Disallow: /ru/')
})
}
})

context('CSS', () => {
beforeEach(() => {
cy.visit('/')
Expand Down
Loading

0 comments on commit 418c8b6

Please sign in to comment.