Changeset View
Changeset View
Standalone View
Standalone View
cypress/utils/index.js
/** | /** | ||||
* Copyright (C) 2019 The Software Heritage developers | * Copyright (C) 2019 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
import axios from 'axios'; | import axios from 'axios'; | ||||
export async function httpGetJson(url) { | export async function httpGetJson(url) { | ||||
const response = await axios.get(url); | const response = await axios.get(url); | ||||
return response.data; | return response.data; | ||||
} | } | ||||
export function checkLanguageHighlighting(language) { | |||||
cy.get('code') | |||||
.should('be.visible') | |||||
.and('have.class', 'hljs') | |||||
.and('have.class', language) | |||||
.and('not.be.empty') | |||||
.find('table.hljs-ln') | |||||
.should('be.visible') | |||||
.and('not.be.empty'); | |||||
} |